@stacksjs/error-handling 0.70.23 → 0.70.25
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.
- package/dist/index.js +413 -129
- package/dist/src/error-page.d.ts +381 -0
- package/dist/src/handler.d.ts +30 -0
- package/dist/src/http.d.ts +49 -0
- package/dist/src/index.d.ts +42 -0
- package/dist/src/model.d.ts +4 -0
- package/dist/src/utils.d.ts +1 -0
- package/package.json +28 -12
- package/dist/handler.d.ts +0 -93
- package/dist/http.d.ts +0 -6
- package/dist/index.d.ts +0 -18
- package/dist/model.d.ts +0 -6
- package/dist/utils.d.ts +0 -1
package/dist/index.js
CHANGED
|
@@ -1,133 +1,417 @@
|
|
|
1
|
-
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UY(g,$){if(!g)return;if(typeof g==="string")return qy(g,$);var y=Object.prototype.toString.call(g).slice(8,-1);if(y==="Object"&&g.constructor)y=g.constructor.name;if(y==="Map"||y==="Set")return Array.from(g);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return qy(g,$)}function qy(g,$){if($==null||$>g.length)$=g.length;for(var y=0,M=new Array($);y<$;y++)M[y]=g[y];return M}function LY(g,$){var y=g==null?null:typeof Symbol!="undefined"&&g[Symbol.iterator]||g["@@iterator"];if(y!=null){var M,q,J,Y,Z=[],z=!0,w=!1;try{if(J=(y=y.call(g)).next,$===0){if(Object(y)!==y)return;z=!1}else for(;!(z=(M=J.call(y)).done)&&(Z.push(M.value),Z.length!==$);z=!0);}catch(K){w=!0,q=K}finally{try{if(!z&&y.return!=null&&(Y=y.return(),Object(Y)!==Y))return}finally{if(w)throw q}}return Z}}function PY(g){if(Array.isArray(g))return g}var BY={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},CY=/^\[([^\]]+)\](?::([0-9]+))?$/;function TY(g){return Object.prototype.toString.call(g)==="[object RegExp]"}function Jy(g,$){for(var y=0;y<$.length;y++){var M=$[y];if(g===M||TY(M)&&M.test(g))return!0}return!1}function kY(g,$){if(WY.default(g),!g||/[\s<>]/.test(g))return!1;if(g.indexOf("mailto:")===0)return!1;if($=QY.default($,BY),$.validate_length&&g.length>=2083)return!1;if(!$.allow_fragments&&g.includes("#"))return!1;if(!$.allow_query_components&&(g.includes("?")||g.includes("&")))return!1;var y,M,q,J,Y,Z,z,w;if(z=g.split("#"),g=z.shift(),z=g.split("?"),g=z.shift(),z=g.split("://"),z.length>1){if(y=z.shift().toLowerCase(),$.require_valid_protocol&&$.protocols.indexOf(y)===-1)return!1}else if($.require_protocol)return!1;else if(g.slice(0,2)==="//"){if(!$.allow_protocol_relative_urls)return!1;z[0]=g.slice(2)}if(g=z.join("://"),g==="")return!1;if(z=g.split("/"),g=z.shift(),g===""&&!$.require_host)return!0;if(z=g.split("@"),z.length>1){if($.disallow_auth)return!1;if(z[0]==="")return!1;if(M=z.shift(),M.indexOf(":")>=0&&M.split(":").length>2)return!1;var K=M.split(":"),L=wY(K,2),C=L[0],G=L[1];if(C===""&&G==="")return!1}J=z.join("@"),Z=null,w=null;var H=J.match(CY);if(H)q="",w=H[1],Z=H[2]||null;else if(z=J.split(":"),q=z.shift(),z.length)Z=z.join(":");if(Z!==null&&Z.length>0){if(Y=parseInt(Z,10),!/^[0-9]+$/.test(Z)||Y<=0||Y>65535)return!1}else if($.require_port)return!1;if($.host_whitelist)return Jy(q,$.host_whitelist);if(q===""&&!$.require_host)return!0;if(!My.default(q)&&!xY.default(q,$)&&(!w||!My.default(w,6)))return!1;if(q=q||w,$.host_blacklist&&Jy(q,$.host_blacklist))return!1;return!0}n$.exports=rg.default;n$.exports.default=rg.default});var Zy=B((fg,c$)=>{Object.defineProperty(fg,"__esModule",{value:!0});fg.default=jY;var VY=mY(v());function mY(g){return g&&g.__esModule?g:{default:g}}var IY=/^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/;function jY(g){return VY.default(g),IY.test(g)}c$.exports=fg.default;c$.exports.default=fg.default});var Hy=B((zy)=>{Object.defineProperty(zy,"__esModule",{value:!0});zy.default=RY;zy.locales=void 0;var FY=hY(v());function hY(g){return g&&g.__esModule?g:{default:g}}var dg={AD:/^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,AE:/^(AE[0-9]{2})\d{3}\d{16}$/,AL:/^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,AT:/^(AT[0-9]{2})\d{16}$/,AZ:/^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,BA:/^(BA[0-9]{2})\d{16}$/,BE:/^(BE[0-9]{2})\d{12}$/,BG:/^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,BH:/^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,BR:/^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,BY:/^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,CH:/^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,CR:/^(CR[0-9]{2})\d{18}$/,CY:/^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,CZ:/^(CZ[0-9]{2})\d{20}$/,DE:/^(DE[0-9]{2})\d{18}$/,DK:/^(DK[0-9]{2})\d{14}$/,DO:/^(DO[0-9]{2})[A-Z]{4}\d{20}$/,DZ:/^(DZ\d{24})$/,EE:/^(EE[0-9]{2})\d{16}$/,EG:/^(EG[0-9]{2})\d{25}$/,ES:/^(ES[0-9]{2})\d{20}$/,FI:/^(FI[0-9]{2})\d{14}$/,FO:/^(FO[0-9]{2})\d{14}$/,FR:/^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,GB:/^(GB[0-9]{2})[A-Z]{4}\d{14}$/,GE:/^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,GI:/^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,GL:/^(GL[0-9]{2})\d{14}$/,GR:/^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,GT:/^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,HR:/^(HR[0-9]{2})\d{17}$/,HU:/^(HU[0-9]{2})\d{24}$/,IE:/^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/,IL:/^(IL[0-9]{2})\d{19}$/,IQ:/^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,IR:/^(IR[0-9]{2})0\d{2}0\d{18}$/,IS:/^(IS[0-9]{2})\d{22}$/,IT:/^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,JO:/^(JO[0-9]{2})[A-Z]{4}\d{22}$/,KW:/^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,KZ:/^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,LB:/^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,LC:/^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,LI:/^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,LT:/^(LT[0-9]{2})\d{16}$/,LU:/^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,LV:/^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,MA:/^(MA[0-9]{26})$/,MC:/^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,MD:/^(MD[0-9]{2})[A-Z0-9]{20}$/,ME:/^(ME[0-9]{2})\d{18}$/,MK:/^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,MR:/^(MR[0-9]{2})\d{23}$/,MT:/^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,MU:/^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,MZ:/^(MZ[0-9]{2})\d{21}$/,NL:/^(NL[0-9]{2})[A-Z]{4}\d{10}$/,NO:/^(NO[0-9]{2})\d{11}$/,PK:/^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,PL:/^(PL[0-9]{2})\d{24}$/,PS:/^(PS[0-9]{2})[A-Z0-9]{4}\d{21}$/,PT:/^(PT[0-9]{2})\d{21}$/,QA:/^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,RO:/^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,RS:/^(RS[0-9]{2})\d{18}$/,SA:/^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,SC:/^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,SE:/^(SE[0-9]{2})\d{20}$/,SI:/^(SI[0-9]{2})\d{15}$/,SK:/^(SK[0-9]{2})\d{20}$/,SM:/^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,SV:/^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,TL:/^(TL[0-9]{2})\d{19}$/,TN:/^(TN[0-9]{2})\d{20}$/,TR:/^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,UA:/^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,VA:/^(VA[0-9]{2})\d{18}$/,VG:/^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/,XK:/^(XK[0-9]{2})\d{16}$/};function SY(g){var $=g.filter(function(y){return!(y in dg)});if($.length>0)return!1;return!0}function uY(g,$){var y=g.replace(/[\s\-]+/gi,"").toUpperCase(),M=y.slice(0,2).toUpperCase(),q=M in dg;if($.whitelist){if(!SY($.whitelist))return!1;var J=$.whitelist.includes(M);if(!J)return!1}if($.blacklist){var Y=$.blacklist.includes(M);if(Y)return!1}return q&&dg[M].test(y)}function NY(g){var $=g.replace(/[^A-Z0-9]+/gi,"").toUpperCase(),y=$.slice(4)+$.slice(0,4),M=y.replace(/[A-Z]/g,function(J){return J.charCodeAt(0)-55}),q=M.match(/\d{1,7}/g).reduce(function(J,Y){return Number(J+Y)%97},"");return q===1}function RY(g){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return FY.default(g),uY(g,$)&&NY(g)}var R8=zy.locales=Object.keys(dg)});var Dy=B((tg,v$)=>{Object.defineProperty(tg,"__esModule",{value:!0});tg.default=rY;var nY=cY(v());function cY(g){return g&&g.__esModule?g:{default:g}}var vY={1:/^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,2:/^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,7:/^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};function rY(g,$){nY.default(g);var y=vY[![void 0,null].includes($)?$:"all"];return!!y&&y.test(g)}v$.exports=tg.default;v$.exports.default=tg.default});var Oy=B((ig,r$)=>{Object.defineProperty(ig,"__esModule",{value:!0});ig.default=aY;var dY=tY(v());function tY(g){return g&&g.__esModule?g:{default:g}}var iY=/^[\x00-\x7F]+$/;function aY(g){return dY.default(g),iY.test(g)}r$.exports=ig.default;r$.exports.default=ig.default});var Xy=B((ag,d$)=>{Object.defineProperty(ag,"__esModule",{value:!0});ag.default=sY;var lY=oY(v());function oY(g){return g&&g.__esModule?g:{default:g}}function f$(g){return f$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},f$(g)}function sY(g,$){lY.default(g);var y,M;if(f$($)==="object")y=$.min||0,M=$.max;else y=arguments[1],M=arguments[2];var q=encodeURI(g).split(/%..|./).length-1;return q>=y&&(typeof M==="undefined"||q<=M)}d$.exports=ag.default;d$.exports.default=ag.default});var Wy=B((pg,i$)=>{Object.defineProperty(pg,"__esModule",{value:!0});pg.default=OZ;var gZ=Yg(v()),t$=Yg(Xy()),$Z=Yg(b$()),Gy=Yg(Ng()),yZ=Yg(u0());function Yg(g){return g&&g.__esModule?g:{default:g}}var MZ={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},qZ=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,JZ=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,YZ=/^[a-z\d]+$/,ZZ=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,zZ=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,KZ=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,HZ=254;function DZ(g){var $=g.replace(/^"(.+)"$/,"$1");if(!$.trim())return!1;var y=/[\.";<>]/.test($);if(y){if($===g)return!1;var M=$.split('"').length===$.split("\\\"").length;if(!M)return!1}return!0}function OZ(g,$){if(gZ.default(g),$=yZ.default($,MZ),$.require_display_name||$.allow_display_name){var y=g.match(qZ);if(y){var M=y[1];if(g=g.replace(M,"").replace(/(^<|>$)/g,""),M.endsWith(" "))M=M.slice(0,-1);if(!DZ(M))return!1}else if($.require_display_name)return!1}if(!$.ignore_max_length&&g.length>HZ)return!1;var q=g.split("@"),J=q.pop(),Y=J.toLowerCase();if($.host_blacklist.includes(Y))return!1;if($.host_whitelist.length>0&&!$.host_whitelist.includes(Y))return!1;var Z=q.join("@");if($.domain_specific_validation&&(Y==="gmail.com"||Y==="googlemail.com")){Z=Z.toLowerCase();var z=Z.split("+")[0];if(!t$.default(z.replace(/\./g,""),{min:6,max:30}))return!1;var w=z.split(".");for(var K=0;K<w.length;K++)if(!YZ.test(w[K]))return!1}if($.ignore_max_length===!1&&(!t$.default(Z,{max:64})||!t$.default(J,{max:254})))return!1;if(!$Z.default(J,{require_tld:$.require_tld,ignore_max_length:$.ignore_max_length,allow_underscores:$.allow_underscores})){if(!$.allow_ip_domain)return!1;if(!Gy.default(J)){if(!J.startsWith("[")||!J.endsWith("]"))return!1;var L=J.slice(1,-1);if(L.length===0||!Gy.default(L))return!1}}if(Z[0]==='"')return Z=Z.slice(1,Z.length-1),$.allow_utf8_local_part?KZ.test(Z):ZZ.test(Z);var C=$.allow_utf8_local_part?zZ:JZ,G=Z.split(".");for(var H=0;H<G.length;H++)if(!C.test(G[H]))return!1;if($.blacklisted_chars){if(Z.search(new RegExp("[".concat($.blacklisted_chars,"]+"),"g"))!==-1)return!1}return!0}i$.exports=pg.default;i$.exports.default=pg.default});var lg=B((Py)=>{Object.defineProperty(Py,"__esModule",{value:!0});Py.farsiLocales=Py.englishLocales=Py.dotDecimal=Py.decimal=Py.commaDecimal=Py.bengaliLocales=Py.arabicLocales=Py.alphanumeric=Py.alpha=void 0;var D0=Py.alpha={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[А-Я]+$/i,"cs-CZ":/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[A-ZÆØÅ]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"el-GR":/^[Α-ώ]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fa-IR":/^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,"fi-FI":/^[A-ZÅÄÖ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"nb-NO":/^[A-ZÆØÅ]+$/i,"nl-NL":/^[A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[A-ZÆØÅ]+$/i,"hu-HU":/^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"pl-PL":/^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[А-ЯЁ]+$/i,"kk-KZ":/^[А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๐\s]+$/i,"tr-TR":/^[A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[А-ЩЬЮЯЄIЇҐі]+$/i,"vi-VN":/^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,"ko-KR":/^[ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[א-ת]+$/,fa:/^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0961]+[\u0972-\u097F]*$/i,"si-LK":/^[\u0D80-\u0DFF]+$/},O0=Py.alphanumeric={"en-US":/^[0-9A-Z]+$/i,"az-AZ":/^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[0-9А-Я]+$/i,"cs-CZ":/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[0-9A-ZÆØÅ]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"el-GR":/^[0-9Α-ω]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fi-FI":/^[0-9A-ZÅÄÖ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"hu-HU":/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"nb-NO":/^[0-9A-ZÆØÅ]+$/i,"nl-NL":/^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[0-9A-ZÆØÅ]+$/i,"pl-PL":/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁ]+$/i,"kk-KZ":/^[0-9А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[0-9A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[0-9A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[0-9А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[0-9A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๙\s]+$/i,"tr-TR":/^[0-9A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,"ko-KR":/^[0-9ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,"vi-VN":/^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[0-9א-ת]+$/,fa:/^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0963]+[\u0966-\u097F]*$/i,"si-LK":/^[0-9\u0D80-\u0DFF]+$/},q0=Py.decimal={"en-US":".",ar:"٫"},xy=Py.englishLocales=["AU","GB","HK","IN","NZ","ZA","ZM"];for(Zg=0;Zg<xy.length;Zg++)t0="en-".concat(xy[Zg]),D0[t0]=D0["en-US"],O0[t0]=O0["en-US"],q0[t0]=q0["en-US"];var t0,Zg,Qy=Py.arabicLocales=["AE","BH","DZ","EG","IQ","JO","KW","LB","LY","MA","QM","QA","SA","SD","SY","TN","YE"];for(zg=0;zg<Qy.length;zg++)i0="ar-".concat(Qy[zg]),D0[i0]=D0.ar,O0[i0]=O0.ar,q0[i0]=q0.ar;var i0,zg,wy=Py.farsiLocales=["IR","AF"];for(Hg=0;Hg<wy.length;Hg++)Kg="fa-".concat(wy[Hg]),O0[Kg]=O0.fa,q0[Kg]=q0.ar;var Kg,Hg,_y=Py.bengaliLocales=["BD","IN"];for(Dg=0;Dg<_y.length;Dg++)a0="bn-".concat(_y[Dg]),D0[a0]=D0.bn,O0[a0]=O0.bn,q0[a0]=q0["en-US"];var a0,Dg,Uy=Py.dotDecimal=["ar-EG","ar-LB","ar-LY"],Ly=Py.commaDecimal=["bg-BG","cs-CZ","da-DK","de-DE","el-GR","en-ZM","eo","es-ES","fr-CA","fr-FR","id-ID","it-IT","ku-IQ","hi-IN","hu-HU","nb-NO","nn-NO","nl-NL","pl-PL","pt-PT","ru-RU","kk-KZ","si-LK","sl-SI","sr-RS@latin","sr-RS","sv-SE","tr-TR","uk-UA","vi-VN"];for(Og=0;Og<Uy.length;Og++)q0[Uy[Og]]=q0["en-US"];var Og;for(Xg=0;Xg<Ly.length;Xg++)q0[Ly[Xg]]=",";var Xg;D0["fr-CA"]=D0["fr-FR"];O0["fr-CA"]=O0["fr-FR"];D0["pt-BR"]=D0["pt-PT"];O0["pt-BR"]=O0["pt-PT"];q0["pt-BR"]=q0["pt-PT"];D0["pl-Pl"]=D0["pl-PL"];O0["pl-Pl"]=O0["pl-PL"];q0["pl-Pl"]=q0["pl-PL"];D0["fa-AF"]=D0.fa});var ky=B((Cy)=>{Object.defineProperty(Cy,"__esModule",{value:!0});Cy.default=CZ;Cy.locales=void 0;var PZ=BZ(v()),a$=lg();function BZ(g){return g&&g.__esModule?g:{default:g}}function CZ(g){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};PZ.default(g);var M=g,q=y.ignore;if(q)if(q instanceof RegExp)M=M.replace(q,"");else if(typeof q==="string")M=M.replace(new RegExp("[".concat(q.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if($ in a$.alpha)return a$.alpha[$].test(M);throw new Error("Invalid locale '".concat($,"'"))}var c8=Cy.locales=Object.keys(a$.alpha)});var Vy=B((og,p$)=>{Object.defineProperty(og,"__esModule",{value:!0});og.default=FZ;var kZ=Ay(v()),AZ=Ay(u0());function Ay(g){return g&&g.__esModule?g:{default:g}}var VZ=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,mZ=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,IZ=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,jZ=/^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i,EZ={checkDMS:!1};function FZ(g,$){if(kZ.default(g),$=AZ.default($,EZ),!g.includes(","))return!1;var y=g.split(",");if(y[0].startsWith("(")&&!y[1].endsWith(")")||y[1].endsWith(")")&&!y[0].startsWith("("))return!1;if($.checkDMS)return IZ.test(y[0])&&jZ.test(y[1]);return VZ.test(y[0])&&mZ.test(y[1])}p$.exports=og.default;p$.exports.default=og.default});var Iy=B((sg,l$)=>{Object.defineProperty(sg,"__esModule",{value:!0});sg.default=void 0;var SZ=function g($,y){return $.some(function(M){return y===M})},r8=sg.default=SZ;l$.exports=sg.default;l$.exports.default=sg.default});var Ey=B((eg,s$)=>{Object.defineProperty(eg,"__esModule",{value:!0});eg.default=vZ;var uZ=o$(u0()),NZ=o$(v()),RZ=o$(Iy()),jy=lg();function o$(g){return g&&g.__esModule?g:{default:g}}function bZ(g){var $=new RegExp("^[-+]?([0-9]+)?(\\".concat(jy.decimal[g.locale],"[0-9]{").concat(g.decimal_digits,"})").concat(g.force_decimal?"":"?","$"));return $}var nZ={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},cZ=["","-","+"];function vZ(g,$){if(NZ.default(g),$=uZ.default($,nZ),$.locale in jy.decimal)return!RZ.default(cZ,g.replace(/ /g,""))&&bZ($).test(g);throw new Error("Invalid locale '".concat($.locale,"'"))}s$.exports=eg.default;s$.exports.default=eg.default});var Fy=B((g$,e$)=>{Object.defineProperty(g$,"__esModule",{value:!0});g$.default=iZ;var fZ=dZ(v());function dZ(g){return g&&g.__esModule?g:{default:g}}var tZ=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;function iZ(g){return fZ.default(g),tZ.test(g)}e$.exports=g$.default;e$.exports.default=g$.default});var hy=B(($$,g1)=>{Object.defineProperty($$,"__esModule",{value:!0});$$.default=oZ;var pZ=lZ(v());function lZ(g){return g&&g.__esModule?g:{default:g}}function oZ(g){pZ.default(g);var $=g.replace(/[- ]+/g,""),y=0,M,q,J;for(var Y=$.length-1;Y>=0;Y--){if(M=$.substring(Y,Y+1),q=parseInt(M,10),J)if(q*=2,q>=10)y+=q%10+1;else y+=q;else y+=q;J=!J}return!!(y%10===0?$:!1)}g1.exports=$$.default;g1.exports.default=$$.default});var uy=B((y$,$1)=>{Object.defineProperty(y$,"__esModule",{value:!0});y$.default=y6;var eZ=Sy(v()),g6=Sy(hy());function Sy(g){return g&&g.__esModule?g:{default:g}}var p0={amex:/^3[47][0-9]{13}$/,dinersclub:/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,discover:/^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,jcb:/^(?:2131|1800|35\d{3})\d{11}$/,mastercard:/^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/,unionpay:/^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,visa:/^(?:4[0-9]{12})(?:[0-9]{3,6})?$/},$6=function(){var g=[];for(var $ in p0)if(p0.hasOwnProperty($))g.push(p0[$]);return g}();function y6(g){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};eZ.default(g);var y=$.provider,M=g.replace(/[- ]+/g,"");if(y&&y.toLowerCase()in p0){if(!p0[y.toLowerCase()].test(M))return!1}else if(y&&!(y.toLowerCase()in p0))throw new Error("".concat(y," is not a valid credit card provider."));else if(!$6.some(function(q){return q.test(M)}))return!1;return g6.default(g)}$1.exports=y$.default;$1.exports.default=y$.default});var by=B((Ny)=>{Object.defineProperty(Ny,"__esModule",{value:!0});Ny.default=Y6;Ny.locales=void 0;var q6=J6(v()),y1=lg();function J6(g){return g&&g.__esModule?g:{default:g}}function Y6(g){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};q6.default(g);var M=g,q=y.ignore;if(q)if(q instanceof RegExp)M=M.replace(q,"");else if(typeof q==="string")M=M.replace(new RegExp("[".concat(q.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if($ in y1.alphanumeric)return y1.alphanumeric[$].test(M);throw new Error("Invalid locale '".concat($,"'"))}var f8=Ny.locales=Object.keys(y1.alphanumeric)});var cy=B((M$,M1)=>{Object.defineProperty(M$,"__esModule",{value:!0});M$.default=H6;var z6=K6(v());function K6(g){return g&&g.__esModule?g:{default:g}}var ny={AM:/^[A-Z]{2}\d{7}$/,AR:/^[A-Z]{3}\d{6}$/,AT:/^[A-Z]\d{7}$/,AU:/^[A-Z]\d{7}$/,AZ:/^[A-Z]{1}\d{8}$/,BE:/^[A-Z]{2}\d{6}$/,BG:/^\d{9}$/,BR:/^[A-Z]{2}\d{6}$/,BY:/^[A-Z]{2}\d{7}$/,CA:/^[A-Z]{2}\d{6}$/,CH:/^[A-Z]\d{7}$/,CN:/^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/,CY:/^[A-Z](\d{6}|\d{8})$/,CZ:/^\d{8}$/,DE:/^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,DK:/^\d{9}$/,DZ:/^\d{9}$/,EE:/^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,ES:/^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,FI:/^[A-Z]{2}\d{7}$/,FR:/^\d{2}[A-Z]{2}\d{5}$/,GB:/^\d{9}$/,GR:/^[A-Z]{2}\d{7}$/,HR:/^\d{9}$/,HU:/^[A-Z]{2}(\d{6}|\d{7})$/,IE:/^[A-Z0-9]{2}\d{7}$/,IN:/^[A-Z]{1}-?\d{7}$/,ID:/^[A-C]\d{7}$/,IR:/^[A-Z]\d{8}$/,IS:/^(A)\d{7}$/,IT:/^[A-Z0-9]{2}\d{7}$/,JM:/^[Aa]\d{7}$/,JP:/^[A-Z]{2}\d{7}$/,KR:/^[MS]\d{8}$/,KZ:/^[a-zA-Z]\d{7}$/,LI:/^[a-zA-Z]\d{5}$/,LT:/^[A-Z0-9]{8}$/,LU:/^[A-Z0-9]{8}$/,LV:/^[A-Z0-9]{2}\d{7}$/,LY:/^[A-Z0-9]{8}$/,MT:/^\d{7}$/,MZ:/^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/,MY:/^[AHK]\d{8}$/,MX:/^\d{10,11}$/,NL:/^[A-Z]{2}[A-Z0-9]{6}\d$/,NZ:/^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/,PH:/^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/,PK:/^[A-Z]{2}\d{7}$/,PL:/^[A-Z]{2}\d{7}$/,PT:/^[A-Z]\d{6}$/,RO:/^\d{8,9}$/,RU:/^\d{9}$/,SE:/^\d{8}$/,SL:/^(P)[A-Z]\d{7}$/,SK:/^[0-9A-Z]\d{7}$/,TH:/^[A-Z]{1,2}\d{6,7}$/,TR:/^[A-Z]\d{8}$/,UA:/^[A-Z]{2}\d{6}$/,US:/^\d{9}$/,ZA:/^[TAMD]\d{8}$/};function H6(g,$){z6.default(g);var y=g.replace(/\s/g,"").toUpperCase();return $.toUpperCase()in ny&&ny[$].test(y)}M1.exports=M$.default;M1.exports.default=M$.default});var J1=B((ry)=>{Object.defineProperty(ry,"__esModule",{value:!0});ry.default=G6;ry.locales=void 0;var O6=X6(v());function X6(g){return g&&g.__esModule?g:{default:g}}var vy=/^\d{3}$/,W0=/^\d{4}$/,J0=/^\d{5}$/,q1=/^\d{6}$/,l0={AD:/^AD\d{3}$/,AT:W0,AU:W0,AZ:/^AZ\d{4}$/,BA:/^([7-8]\d{4}$)/,BE:W0,BG:W0,BR:/^\d{5}-\d{3}$/,BY:/^2[1-4]\d{4}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:W0,CN:/^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,CZ:/^\d{3}\s?\d{2}$/,DE:J0,DK:W0,DO:J0,DZ:J0,EE:J0,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:J0,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HT:/^HT\d{4}$/,HU:W0,ID:J0,IE:/^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,IL:/^(\d{5}|\d{7})$/,IN:/^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,IR:/^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/,IS:vy,IT:J0,JP:/^\d{3}\-\d{4}$/,KE:J0,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:W0,LV:/^LV\-\d{4}$/,LK:J0,MG:vy,MX:J0,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:J0,NL:/^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i,NO:W0,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:W0,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:q1,RU:q1,SA:J0,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:q1,SI:W0,SK:/^\d{3}\s?\d{2}$/,TH:J0,TN:W0,TW:/^\d{3}(\d{2})?$/,UA:J0,US:/^\d{5}(-\d{4})?$/,ZA:W0,ZM:J0},t8=ry.locales=Object.keys(l0);function G6(g,$){if(O6.default(g),$ in l0)return l0[$].test(g);else if($==="any"){for(var y in l0)if(l0.hasOwnProperty(y)){var M=l0[y];if(M.test(g))return!0}return!1}throw new Error("Invalid locale '".concat($,"'"))}});var Y1=B((dy)=>{Object.defineProperty(dy,"__esModule",{value:!0});dy.default=w6;dy.locales=void 0;var x6=Q6(v());function Q6(g){return g&&g.__esModule?g:{default:g}}var n={"am-AM":/^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-BH":/^(\+?973)?(3|6)\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-LB":/^(\+?961)?((3|81)\d{6}|7\d{7})$/,"ar-EG":/^((\+?20)|0)?1[0125]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)([569]\d{7}|41\d{6})$/,"ar-LY":/^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,"ar-MA":/^(?:(?:\+|00)212|0)[5-7]\d{8}$/,"ar-OM":/^((\+|00)968)?(9[1-9])\d{6}$/,"ar-PS":/^(\+?970|0)5[6|9](\d{7})$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SD":/^((\+?249)|0)?(9[012369]|1[012])\d{7}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"az-AZ":/^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,"bs-BA":/^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/^(\+?880|0)1[13456789][0-9]{8}$/,"ca-AD":/^(\+376)?[346]\d{5}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,"de-AT":/^(\+43|0)\d{1,4}\d{3,12}$/,"de-CH":/^(\+41|0)([1-9])\d{1,9}$/,"de-LU":/^(\+352)?((6\d1)\d{6})$/,"dv-MV":/^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,"el-GR":/^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,"el-CY":/^(\+?357?)?(9(9|6)\d{6})$/,"en-AI":/^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-AG":/^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,"en-BM":/^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,"en-BS":/^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-GG":/^(\+?44|0)1481\d{6}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,"en-GY":/^(\+592|0)6\d{6}$/,"en-HK":/^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,"en-MO":/^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-JM":/^(\+?876)?\d{7}$/,"en-KE":/^(\+?254|0)(7|1)\d{8}$/,"fr-CF":/^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/,"en-SS":/^(\+?211|0)(9[1257])\d{7}$/,"en-KI":/^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,"en-KN":/^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,"en-LS":/^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,"en-MT":/^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-MW":/^(\+?265|0)(((77|88|31|99|98|21)\d{7})|(((111)|1)\d{6})|(32000\d{4}))$/,"en-NA":/^(\+?264|0)(6|8)\d{7}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PG":/^(\+?675|0)?(7\d|8[18])\d{6}$/,"en-PK":/^((00|\+)?92|0)3[0-6]\d{8}$/,"en-PH":/^(09|\+639)\d{9}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[3689]\d{7}$/,"en-SL":/^(\+?232|0)\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"en-ZW":/^(\+263)[0-9]{9}$/,"en-BW":/^(\+?267)?(7[1-8]{1})\d{6}$/,"es-AR":/^\+?549(11|[2368]\d)\d{8}$/,"es-BO":/^(\+?591)?(6|7)\d{7}$/,"es-CO":/^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,"es-CL":/^(\+?56|0)[2-9]\d{1}\d{7}$/,"es-CR":/^(\+506)?[2-8]\d{7}$/,"es-CU":/^(\+53|0053)?5\d{7}$/,"es-DO":/^(\+?1)?8[024]9\d{7}$/,"es-HN":/^(\+?504)?[9|8|3|2]\d{7}$/,"es-EC":/^(\+?593|0)([2-7]|9[2-9])\d{7}$/,"es-ES":/^(\+?34)?[6|7]\d{8}$/,"es-PE":/^(\+?51)?9\d{8}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-NI":/^(\+?505)\d{7,8}$/,"es-PA":/^(\+?507)\d{7,8}$/,"es-PY":/^(\+?595|0)9[9876]\d{7}$/,"es-SV":/^(\+?503)?[67]\d{7}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"es-VE":/^(\+?58)?(2|4)\d{9}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,"fj-FJ":/^(\+?679)?\s?\d{3}\s?\d{4}$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-BF":/^(\+226|0)[67]\d{7}$/,"fr-BJ":/^(\+229)\d{8}$/,"fr-CD":/^(\+?243|0)?(8|9)\d{8}$/,"fr-CM":/^(\+?237)6[0-9]{8}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"fr-GF":/^(\+?594|0|00594)[67]\d{8}$/,"fr-GP":/^(\+?590|0|00590)[67]\d{8}$/,"fr-MQ":/^(\+?596|0|00596)[67]\d{8}$/,"fr-PF":/^(\+?689)?8[789]\d{6}$/,"fr-RE":/^(\+?262|0|00262)[67]\d{8}$/,"fr-WF":/^(\+681)?\d{6}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36|06)(20|30|31|50|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"ir-IR":/^(\+98|0)?9\d{9}$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"it-SM":/^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,"ja-JP":/^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,"ka-GE":/^(\+?995)?(79\d{7}|5\d{8})$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"ky-KG":/^(\+?7\s?\+?7|0)\s?\d{2}\s?\d{3}\s?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"lv-LV":/^(\+?371)2\d{7}$/,"mg-MG":/^((\+?261|0)(2|3)\d)?\d{7}$/,"mn-MN":/^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/,"my-MM":/^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,"ms-MY":/^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,"mz-MZ":/^(\+?258)?8[234567]\d{7}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"ne-NP":/^(\+?977)?9[78]\d{8}$/,"nl-BE":/^(\+?32|0)4\d{8}$/,"nl-NL":/^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,"nl-AW":/^(\+)?297(56|59|64|73|74|99)\d{5}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"pt-AO":/^(\+244)\d{9}$/,"ro-MD":/^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,"ro-RO":/^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"si-LK":/^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"so-SO":/^(\+?252|0)((6[0-9])\d{7}|(7[1-9])\d{7})$/,"sq-AL":/^(\+355|0)6[789]\d{6}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"tg-TJ":/^(\+?992)?[5][5]\d{7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"tk-TM":/^(\+993|993|8)\d{8}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"uz-UZ":/^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,"vi-VN":/^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"dz-BT":/^(\+?975|0)?(17|16|77|02)\d{6}$/,"ar-YE":/^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,"ar-EH":/^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,"fa-AF":/^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/};n["en-CA"]=n["en-US"];n["fr-CA"]=n["en-CA"];n["fr-BE"]=n["nl-BE"];n["zh-HK"]=n["en-HK"];n["zh-MO"]=n["en-MO"];n["ga-IE"]=n["en-IE"];n["fr-CH"]=n["de-CH"];n["it-CH"]=n["fr-CH"];function w6(g,$,y){if(x6.default(g),y&&y.strictMode&&!g.startsWith("+"))return!1;if(Array.isArray($))return $.some(function(J){if(n.hasOwnProperty(J)){var Y=n[J];if(Y.test(g))return!0}return!1});else if($ in n)return n[$].test(g);else if(!$||$==="any"){for(var M in n)if(n.hasOwnProperty(M)){var q=n[M];if(q.test(g))return!0}return!1}throw new Error("Invalid locale '".concat($,"'"))}var a8=dy.locales=Object.keys(n)});var O1=B((H1,D1)=>{(function(g,$){typeof H1=="object"&&typeof D1!="undefined"?D1.exports=$():typeof define=="function"&&define.amd?define($):(g=typeof globalThis!="undefined"?globalThis:g||self).dayjs=$()})(H1,function(){var g=1000,$=60000,y=3600000,M="millisecond",q="second",J="minute",Y="hour",Z="day",z="week",w="month",K="quarter",L="year",C="date",G="Invalid Date",H=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,V=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var X=["th","st","nd","rd"],D=P%100;return"["+P+(X[(D-20)%10]||X[D]||X[0])+"]"}},I=function(P,X,D){var W=String(P);return!W||W.length>=X?P:""+Array(X+1-W.length).join(D)+P},N={s:I,z:function(P){var X=-P.utcOffset(),D=Math.abs(X),W=Math.floor(D/60),O=D%60;return(X<=0?"+":"-")+I(W,2,"0")+":"+I(O,2,"0")},m:function P(X,D){if(X.date()<D.date())return-P(D,X);var W=12*(D.year()-X.year())+(D.month()-X.month()),O=X.clone().add(W,w),_=D-O<0,T=X.clone().add(W+(_?-1:1),w);return+(-(W+(D-O)/(_?O-T:T-O))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:w,y:L,w:z,d:Z,D:C,h:Y,m:J,s:q,ms:M,Q:K}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},h="en",t={};t[h]=m;var G0="$isDayjsObject",g0=function(P){return P instanceof E||!(!P||!P[G0])},$0=function P(X,D,W){var O;if(!X)return h;if(typeof X=="string"){var _=X.toLowerCase();t[_]&&(O=_),D&&(t[_]=D,O=_);var T=X.split("-");if(!O&&T.length>1)return P(T[0])}else{var k=X.name;t[k]=X,O=k}return!W&&O&&(h=O),O||!W&&h},S=function(P,X){if(g0(P))return P.clone();var D=typeof X=="object"?X:{};return D.date=P,D.args=arguments,new E(D)},x=N;x.l=$0,x.i=g0,x.w=function(P,X){return S(P,{locale:X.$L,utc:X.$u,x:X.$x,$offset:X.$offset})};var E=function(){function P(D){this.$L=$0(D.locale,null,!0),this.parse(D),this.$x=this.$x||D.x||{},this[G0]=!0}var X=P.prototype;return X.parse=function(D){this.$d=function(W){var{date:O,utc:_}=W;if(O===null)return new Date(NaN);if(x.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var T=O.match(H);if(T){var k=T[2]-1||0,R=(T[7]||"0").substring(0,3);return _?new Date(Date.UTC(T[1],k,T[3]||1,T[4]||0,T[5]||0,T[6]||0,R)):new Date(T[1],k,T[3]||1,T[4]||0,T[5]||0,T[6]||0,R)}}return new Date(O)}(D),this.init()},X.init=function(){var D=this.$d;this.$y=D.getFullYear(),this.$M=D.getMonth(),this.$D=D.getDate(),this.$W=D.getDay(),this.$H=D.getHours(),this.$m=D.getMinutes(),this.$s=D.getSeconds(),this.$ms=D.getMilliseconds()},X.$utils=function(){return x},X.isValid=function(){return this.$d.toString()!==G},X.isSame=function(D,W){var O=S(D);return this.startOf(W)<=O&&O<=this.endOf(W)},X.isAfter=function(D,W){return S(D)<this.startOf(W)},X.isBefore=function(D,W){return this.endOf(W)<S(D)},X.$g=function(D,W,O){return x.u(D)?this[W]:this.set(O,D)},X.unix=function(){return Math.floor(this.valueOf()/1000)},X.valueOf=function(){return this.$d.getTime()},X.startOf=function(D,W){var O=this,_=!!x.u(W)||W,T=x.p(D),k=function(C0,o){var w0=x.w(O.$u?Date.UTC(O.$y,o,C0):new Date(O.$y,o,C0),O);return _?w0:w0.endOf(Z)},R=function(C0,o){return x.w(O.toDate()[C0].apply(O.toDate("s"),(_?[0,0,0,0]:[23,59,59,999]).slice(o)),O)},c=this.$W,a=this.$M,H0=this.$D,F0="set"+(this.$u?"UTC":"");switch(T){case L:return _?k(1,0):k(31,11);case w:return _?k(1,a):k(0,a+1);case z:var V0=this.$locale().weekStart||0,c0=(c<V0?c+7:c)-V0;return k(_?H0-c0:H0+(6-c0),a);case Z:case C:return R(F0+"Hours",0);case Y:return R(F0+"Minutes",1);case J:return R(F0+"Seconds",2);case q:return R(F0+"Milliseconds",3);default:return this.clone()}},X.endOf=function(D){return this.startOf(D,!1)},X.$set=function(D,W){var O,_=x.p(D),T="set"+(this.$u?"UTC":""),k=(O={},O[Z]=T+"Date",O[C]=T+"Date",O[w]=T+"Month",O[L]=T+"FullYear",O[Y]=T+"Hours",O[J]=T+"Minutes",O[q]=T+"Seconds",O[M]=T+"Milliseconds",O)[_],R=_===Z?this.$D+(W-this.$W):W;if(_===w||_===L){var c=this.clone().set(C,1);c.$d[k](R),c.init(),this.$d=c.set(C,Math.min(this.$D,c.daysInMonth())).$d}else k&&this.$d[k](R);return this.init(),this},X.set=function(D,W){return this.clone().$set(D,W)},X.get=function(D){return this[x.p(D)]()},X.add=function(D,W){var O,_=this;D=Number(D);var T=x.p(W),k=function(a){var H0=S(_);return x.w(H0.date(H0.date()+Math.round(a*D)),_)};if(T===w)return this.set(w,this.$M+D);if(T===L)return this.set(L,this.$y+D);if(T===Z)return k(1);if(T===z)return k(7);var R=(O={},O[J]=$,O[Y]=y,O[q]=g,O)[T]||1,c=this.$d.getTime()+D*R;return x.w(c,this)},X.subtract=function(D,W){return this.add(-1*D,W)},X.format=function(D){var W=this,O=this.$locale();if(!this.isValid())return O.invalidDate||G;var _=D||"YYYY-MM-DDTHH:mm:ssZ",T=x.z(this),k=this.$H,R=this.$m,c=this.$M,a=O.weekdays,H0=O.months,F0=O.meridiem,V0=function(o,w0,m0,h0){return o&&(o[w0]||o(W,_))||m0[w0].slice(0,h0)},c0=function(o){return x.s(k%12||12,o,"0")},C0=F0||function(o,w0,m0){var h0=o<12?"AM":"PM";return m0?h0.toLowerCase():h0};return _.replace(V,function(o,w0){return w0||function(m0){switch(m0){case"YY":return String(W.$y).slice(-2);case"YYYY":return x.s(W.$y,4,"0");case"M":return c+1;case"MM":return x.s(c+1,2,"0");case"MMM":return V0(O.monthsShort,c,H0,3);case"MMMM":return V0(H0,c);case"D":return W.$D;case"DD":return x.s(W.$D,2,"0");case"d":return String(W.$W);case"dd":return V0(O.weekdaysMin,W.$W,a,2);case"ddd":return V0(O.weekdaysShort,W.$W,a,3);case"dddd":return a[W.$W];case"H":return String(k);case"HH":return x.s(k,2,"0");case"h":return c0(1);case"hh":return c0(2);case"a":return C0(k,R,!0);case"A":return C0(k,R,!1);case"m":return String(R);case"mm":return x.s(R,2,"0");case"s":return String(W.$s);case"ss":return x.s(W.$s,2,"0");case"SSS":return x.s(W.$ms,3,"0");case"Z":return T}return null}(o)||T.replace(":","")})},X.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},X.diff=function(D,W,O){var _,T=this,k=x.p(W),R=S(D),c=(R.utcOffset()-this.utcOffset())*$,a=this-R,H0=function(){return x.m(T,R)};switch(k){case L:_=H0()/12;break;case w:_=H0();break;case K:_=H0()/3;break;case z:_=(a-c)/604800000;break;case Z:_=(a-c)/86400000;break;case Y:_=a/y;break;case J:_=a/$;break;case q:_=a/g;break;default:_=a}return O?_:x.a(_)},X.daysInMonth=function(){return this.endOf(w).$D},X.$locale=function(){return t[this.$L]},X.locale=function(D,W){if(!D)return this.$L;var O=this.clone(),_=$0(D,W,!0);return _&&(O.$L=_),O},X.clone=function(){return x.w(this.$d,this)},X.toDate=function(){return new Date(this.valueOf())},X.toJSON=function(){return this.isValid()?this.toISOString():null},X.toISOString=function(){return this.$d.toISOString()},X.toString=function(){return this.$d.toUTCString()},P}(),j=E.prototype;return S.prototype=j,[["$ms",M],["$s",q],["$m",J],["$H",Y],["$W",Z],["$M",w],["$y",L],["$D",C]].forEach(function(P){j[P[1]]=function(X){return this.$g(X,P[0],P[1])}}),S.extend=function(P,X){return P.$i||(P(X,E,S),P.$i=!0),S},S.locale=$0,S.isDayjs=g0,S.unix=function(P){return S(1000*P)},S.en=t[h],S.Ls=t,S.p={},S})});var _M=B((X1,G1)=>{(function(g,$){typeof X1=="object"&&typeof G1!="undefined"?G1.exports=$():typeof define=="function"&&define.amd?define($):(g=typeof globalThis!="undefined"?globalThis:g||self).dayjs_plugin_isSameOrAfter=$()})(X1,function(){return function(g,$){$.prototype.isSameOrAfter=function(y,M){return this.isSame(y,M)||this.isAfter(y,M)}}})});var UM=B((W1,x1)=>{(function(g,$){typeof W1=="object"&&typeof x1!="undefined"?x1.exports=$():typeof define=="function"&&define.amd?define($):(g=typeof globalThis!="undefined"?globalThis:g||self).dayjs_plugin_isSameOrBefore=$()})(W1,function(){return function(g,$){$.prototype.isSameOrBefore=function(y,M){return this.isSame(y,M)||this.isBefore(y,M)}}})});var LM=B((Q1,w1)=>{(function(g,$){typeof Q1=="object"&&typeof w1!="undefined"?w1.exports=$():typeof define=="function"&&define.amd?define($):(g=typeof globalThis!="undefined"?globalThis:g||self).dayjs_plugin_customParseFormat=$()})(Q1,function(){var g={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},$=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,y=/\d/,M=/\d\d/,q=/\d\d?/,J=/\d*[^-_:/,()\s\d]+/,Y={},Z=function(H){return(H=+H)+(H>68?1900:2000)},z=function(H){return function(V){this[H]=+V}},w=[/[+-]\d\d:?(\d\d)?|Z/,function(H){(this.zone||(this.zone={})).offset=function(V){if(!V)return 0;if(V==="Z")return 0;var m=V.match(/([+-]|\d\d)/g),I=60*m[1]+(+m[2]||0);return I===0?0:m[0]==="+"?-I:I}(H)}],K=function(H){var V=Y[H];return V&&(V.indexOf?V:V.s.concat(V.f))},L=function(H,V){var m,I=Y.meridiem;if(I){for(var N=1;N<=24;N+=1)if(H.indexOf(I(N,0,V))>-1){m=N>12;break}}else m=H===(V?"pm":"PM");return m},C={A:[J,function(H){this.afternoon=L(H,!1)}],a:[J,function(H){this.afternoon=L(H,!0)}],Q:[y,function(H){this.month=3*(H-1)+1}],S:[y,function(H){this.milliseconds=100*+H}],SS:[M,function(H){this.milliseconds=10*+H}],SSS:[/\d{3}/,function(H){this.milliseconds=+H}],s:[q,z("seconds")],ss:[q,z("seconds")],m:[q,z("minutes")],mm:[q,z("minutes")],H:[q,z("hours")],h:[q,z("hours")],HH:[q,z("hours")],hh:[q,z("hours")],D:[q,z("day")],DD:[M,z("day")],Do:[J,function(H){var V=Y.ordinal,m=H.match(/\d+/);if(this.day=m[0],V)for(var I=1;I<=31;I+=1)V(I).replace(/\[|\]/g,"")===H&&(this.day=I)}],w:[q,z("week")],ww:[M,z("week")],M:[q,z("month")],MM:[M,z("month")],MMM:[J,function(H){var V=K("months"),m=(K("monthsShort")||V.map(function(I){return I.slice(0,3)})).indexOf(H)+1;if(m<1)throw new Error;this.month=m%12||m}],MMMM:[J,function(H){var V=K("months").indexOf(H)+1;if(V<1)throw new Error;this.month=V%12||V}],Y:[/[+-]?\d+/,z("year")],YY:[M,function(H){this.year=Z(H)}],YYYY:[/\d{4}/,z("year")],Z:w,ZZ:w};function G(H){var V,m;V=H,m=Y&&Y.formats;for(var I=(H=V.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(S,x,E){var j=E&&E.toUpperCase();return x||m[E]||g[E]||m[j].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(P,X,D){return X||D.slice(1)})})).match($),N=I.length,h=0;h<N;h+=1){var t=I[h],G0=C[t],g0=G0&&G0[0],$0=G0&&G0[1];I[h]=$0?{regex:g0,parser:$0}:t.replace(/^\[|\]$/g,"")}return function(S){for(var x={},E=0,j=0;E<N;E+=1){var P=I[E];if(typeof P=="string")j+=P.length;else{var{regex:X,parser:D}=P,W=S.slice(j),O=X.exec(W)[0];D.call(x,O),S=S.replace(O,"")}}return function(_){var T=_.afternoon;if(T!==void 0){var k=_.hours;T?k<12&&(_.hours+=12):k===12&&(_.hours=0),delete _.afternoon}}(x),x}}return function(H,V,m){m.p.customParseFormat=!0,H&&H.parseTwoDigitYear&&(Z=H.parseTwoDigitYear);var I=V.prototype,N=I.parse;I.parse=function(h){var{date:t,utc:G0,args:g0}=h;this.$u=G0;var $0=g0[1];if(typeof $0=="string"){var S=g0[2]===!0,x=g0[3]===!0,E=S||x,j=g0[2];x&&(j=g0[2]),Y=this.$locale(),!S&&j&&(Y=m.Ls[j]),this.$d=function(W,O,_,T){try{if(["x","X"].indexOf(O)>-1)return new Date((O==="X"?1000:1)*W);var k=G(O)(W),R=k.year,c=k.month,a=k.day,H0=k.hours,F0=k.minutes,V0=k.seconds,c0=k.milliseconds,C0=k.zone,o=k.week,w0=new Date,m0=a||(R||c?1:w0.getDate()),h0=R||w0.getFullYear(),jg=0;R&&!c||(jg=c>0?c-1:w0.getMonth());var Eg,T$=H0||0,k$=F0||0,A$=V0||0,V$=c0||0;return C0?new Date(Date.UTC(h0,jg,m0,T$,k$,A$,V$+60*C0.offset*1000)):_?new Date(Date.UTC(h0,jg,m0,T$,k$,A$,V$)):(Eg=new Date(h0,jg,m0,T$,k$,A$,V$),o&&(Eg=T(Eg).week(o).toDate()),Eg)}catch(XH){return new Date("")}}(t,$0,G0,m),this.init(),j&&j!==!0&&(this.$L=this.locale(j).$L),E&&t!=this.format($0)&&(this.$d=new Date("")),Y={}}else if($0 instanceof Array)for(var P=$0.length,X=1;X<=P;X+=1){g0[1]=$0[X-1];var D=m.apply(this,g0);if(D.isValid()){this.$d=D.$d,this.$L=D.$L,this.init();break}X===P&&(this.$d=new Date(""))}else N.call(this,h)}}})});var PM=B((J$,L1)=>{Object.defineProperty(J$,"__esModule",{value:!0});J$.default=h6;var E6=F6(v());function F6(g){return g&&g.__esModule?g:{default:g}}function h6(g){return E6.default(g),g.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\//g,"/").replace(/\\/g,"\").replace(/`/g,"`")}L1.exports=J$.default;L1.exports.default=J$.default});var BM=B((Y$,P1)=>{Object.defineProperty(Y$,"__esModule",{value:!0});Y$.default=f6;var u6=N6(u0());function N6(g){return g&&g.__esModule?g:{default:g}}var R6={all_lowercase:!0,gmail_lowercase:!0,gmail_remove_dots:!0,gmail_remove_subaddress:!0,gmail_convert_googlemaildotcom:!0,outlookdotcom_lowercase:!0,outlookdotcom_remove_subaddress:!0,yahoo_lowercase:!0,yahoo_remove_subaddress:!0,yandex_lowercase:!0,icloud_lowercase:!0,icloud_remove_subaddress:!0},b6=["icloud.com","me.com"],n6=["hotmail.at","hotmail.be","hotmail.ca","hotmail.cl","hotmail.co.il","hotmail.co.nz","hotmail.co.th","hotmail.co.uk","hotmail.com","hotmail.com.ar","hotmail.com.au","hotmail.com.br","hotmail.com.gr","hotmail.com.mx","hotmail.com.pe","hotmail.com.tr","hotmail.com.vn","hotmail.cz","hotmail.de","hotmail.dk","hotmail.es","hotmail.fr","hotmail.hu","hotmail.id","hotmail.ie","hotmail.in","hotmail.it","hotmail.jp","hotmail.kr","hotmail.lv","hotmail.my","hotmail.ph","hotmail.pt","hotmail.sa","hotmail.sg","hotmail.sk","live.be","live.co.uk","live.com","live.com.ar","live.com.mx","live.de","live.es","live.eu","live.fr","live.it","live.nl","msn.com","outlook.at","outlook.be","outlook.cl","outlook.co.il","outlook.co.nz","outlook.co.th","outlook.com","outlook.com.ar","outlook.com.au","outlook.com.br","outlook.com.gr","outlook.com.pe","outlook.com.tr","outlook.com.vn","outlook.cz","outlook.de","outlook.dk","outlook.es","outlook.fr","outlook.hu","outlook.id","outlook.ie","outlook.in","outlook.it","outlook.jp","outlook.kr","outlook.lv","outlook.my","outlook.ph","outlook.pt","outlook.sa","outlook.sg","outlook.sk","passport.com"],c6=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],v6=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];function r6(g){if(g.length>1)return g;return""}function f6(g,$){$=u6.default($,R6);var y=g.split("@"),M=y.pop(),q=y.join("@"),J=[q,M];if(J[1]=J[1].toLowerCase(),J[1]==="gmail.com"||J[1]==="googlemail.com"){if($.gmail_remove_subaddress)J[0]=J[0].split("+")[0];if($.gmail_remove_dots)J[0]=J[0].replace(/\.+/g,r6);if(!J[0].length)return!1;if($.all_lowercase||$.gmail_lowercase)J[0]=J[0].toLowerCase();J[1]=$.gmail_convert_googlemaildotcom?"gmail.com":J[1]}else if(b6.indexOf(J[1])>=0){if($.icloud_remove_subaddress)J[0]=J[0].split("+")[0];if(!J[0].length)return!1;if($.all_lowercase||$.icloud_lowercase)J[0]=J[0].toLowerCase()}else if(n6.indexOf(J[1])>=0){if($.outlookdotcom_remove_subaddress)J[0]=J[0].split("+")[0];if(!J[0].length)return!1;if($.all_lowercase||$.outlookdotcom_lowercase)J[0]=J[0].toLowerCase()}else if(c6.indexOf(J[1])>=0){if($.yahoo_remove_subaddress){var Y=J[0].split("-");J[0]=Y.length>1?Y.slice(0,-1).join("-"):Y[0]}if(!J[0].length)return!1;if($.all_lowercase||$.yahoo_lowercase)J[0]=J[0].toLowerCase()}else if(v6.indexOf(J[1])>=0){if($.all_lowercase||$.yandex_lowercase)J[0]=J[0].toLowerCase();J[1]="yandex.ru"}else if($.all_lowercase)J[0]=J[0].toLowerCase();return J.join("@")}P1.exports=Y$.default;P1.exports.default=Y$.default});var p=B((bz)=>{bz.fromCallback=function(g){return Object.defineProperty(function(...$){if(typeof $[$.length-1]==="function")g.apply(this,$);else return new Promise((y,M)=>{$.push((q,J)=>q!=null?M(q):y(J)),g.apply(this,$)})},"name",{value:g.name})};bz.fromPromise=function(g){return Object.defineProperty(function(...$){let y=$[$.length-1];if(typeof y!=="function")return g.apply(this,$);else $.pop(),g.apply(this,$).then((M)=>y(null,M),y)},"name",{value:g.name})}});var wq=B((WX,Qq)=>{var N0=i("constants"),vz=process.cwd,G$=null,rz=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!G$)G$=vz.call(process);return G$};try{process.cwd()}catch(g){}if(typeof process.chdir==="function"){if(W$=process.chdir,process.chdir=function(g){G$=null,W$.call(process,g)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,W$)}var W$;Qq.exports=fz;function fz(g){if(N0.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))$(g);if(!g.lutimes)y(g);if(g.chown=J(g.chown),g.fchown=J(g.fchown),g.lchown=J(g.lchown),g.chmod=M(g.chmod),g.fchmod=M(g.fchmod),g.lchmod=M(g.lchmod),g.chownSync=Y(g.chownSync),g.fchownSync=Y(g.fchownSync),g.lchownSync=Y(g.lchownSync),g.chmodSync=q(g.chmodSync),g.fchmodSync=q(g.fchmodSync),g.lchmodSync=q(g.lchmodSync),g.stat=Z(g.stat),g.fstat=Z(g.fstat),g.lstat=Z(g.lstat),g.statSync=z(g.statSync),g.fstatSync=z(g.fstatSync),g.lstatSync=z(g.lstatSync),g.chmod&&!g.lchmod)g.lchmod=function(K,L,C){if(C)process.nextTick(C)},g.lchmodSync=function(){};if(g.chown&&!g.lchown)g.lchown=function(K,L,C,G){if(G)process.nextTick(G)},g.lchownSync=function(){};if(rz==="win32")g.rename=typeof g.rename!=="function"?g.rename:function(K){function L(C,G,H){var V=Date.now(),m=0;K(C,G,function I(N){if(N&&(N.code==="EACCES"||N.code==="EPERM"||N.code==="EBUSY")&&Date.now()-V<60000){if(setTimeout(function(){g.stat(G,function(h,t){if(h&&h.code==="ENOENT")K(C,G,I);else H(N)})},m),m<100)m+=10;return}if(H)H(N)})}if(Object.setPrototypeOf)Object.setPrototypeOf(L,K);return L}(g.rename);g.read=typeof g.read!=="function"?g.read:function(K){function L(C,G,H,V,m,I){var N;if(I&&typeof I==="function"){var h=0;N=function(t,G0,g0){if(t&&t.code==="EAGAIN"&&h<10)return h++,K.call(g,C,G,H,V,m,N);I.apply(this,arguments)}}return K.call(g,C,G,H,V,m,N)}if(Object.setPrototypeOf)Object.setPrototypeOf(L,K);return L}(g.read),g.readSync=typeof g.readSync!=="function"?g.readSync:function(K){return function(L,C,G,H,V){var m=0;while(!0)try{return K.call(g,L,C,G,H,V)}catch(I){if(I.code==="EAGAIN"&&m<10){m++;continue}throw I}}}(g.readSync);function $(K){K.lchmod=function(L,C,G){K.open(L,N0.O_WRONLY|N0.O_SYMLINK,C,function(H,V){if(H){if(G)G(H);return}K.fchmod(V,C,function(m){K.close(V,function(I){if(G)G(m||I)})})})},K.lchmodSync=function(L,C){var G=K.openSync(L,N0.O_WRONLY|N0.O_SYMLINK,C),H=!0,V;try{V=K.fchmodSync(G,C),H=!1}finally{if(H)try{K.closeSync(G)}catch(m){}else K.closeSync(G)}return V}}function y(K){if(N0.hasOwnProperty("O_SYMLINK")&&K.futimes)K.lutimes=function(L,C,G,H){K.open(L,N0.O_SYMLINK,function(V,m){if(V){if(H)H(V);return}K.futimes(m,C,G,function(I){K.close(m,function(N){if(H)H(I||N)})})})},K.lutimesSync=function(L,C,G){var H=K.openSync(L,N0.O_SYMLINK),V,m=!0;try{V=K.futimesSync(H,C,G),m=!1}finally{if(m)try{K.closeSync(H)}catch(I){}else K.closeSync(H)}return V};else if(K.futimes)K.lutimes=function(L,C,G,H){if(H)process.nextTick(H)},K.lutimesSync=function(){}}function M(K){if(!K)return K;return function(L,C,G){return K.call(g,L,C,function(H){if(w(H))H=null;if(G)G.apply(this,arguments)})}}function q(K){if(!K)return K;return function(L,C){try{return K.call(g,L,C)}catch(G){if(!w(G))throw G}}}function J(K){if(!K)return K;return function(L,C,G,H){return K.call(g,L,C,G,function(V){if(w(V))V=null;if(H)H.apply(this,arguments)})}}function Y(K){if(!K)return K;return function(L,C,G){try{return K.call(g,L,C,G)}catch(H){if(!w(H))throw H}}}function Z(K){if(!K)return K;return function(L,C,G){if(typeof C==="function")G=C,C=null;function H(V,m){if(m){if(m.uid<0)m.uid+=4294967296;if(m.gid<0)m.gid+=4294967296}if(G)G.apply(this,arguments)}return C?K.call(g,L,C,H):K.call(g,L,H)}}function z(K){if(!K)return K;return function(L,C){var G=C?K.call(g,L,C):K.call(g,L);if(G){if(G.uid<0)G.uid+=4294967296;if(G.gid<0)G.gid+=4294967296}return G}}function w(K){if(!K)return!0;if(K.code==="ENOSYS")return!0;var L=!process.getuid||process.getuid()!==0;if(L){if(K.code==="EINVAL"||K.code==="EPERM")return!0}return!1}}});var Lq=B((xX,Uq)=>{var _q=i("stream").Stream;Uq.exports=dz;function dz(g){return{ReadStream:$,WriteStream:y};function $(M,q){if(!(this instanceof $))return new $(M,q);_q.call(this);var J=this;this.path=M,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,q=q||{};var Y=Object.keys(q);for(var Z=0,z=Y.length;Z<z;Z++){var w=Y[Z];this[w]=q[w]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){J._read()});return}g.open(this.path,this.flags,this.mode,function(K,L){if(K){J.emit("error",K),J.readable=!1;return}J.fd=L,J.emit("open",L),J._read()})}function y(M,q){if(!(this instanceof y))return new y(M,q);_q.call(this),this.path=M,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,q=q||{};var J=Object.keys(q);for(var Y=0,Z=J.length;Y<Z;Y++){var z=J[Y];this[z]=q[z]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=g.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var Bq=B((QX,Pq)=>{Pq.exports=iz;var tz=Object.getPrototypeOf||function(g){return g.__proto__};function iz(g){if(g===null||typeof g!=="object")return g;if(g instanceof Object)var $={__proto__:tz(g)};else var $=Object.create(null);return Object.getOwnPropertyNames(g).forEach(function(y){Object.defineProperty($,y,Object.getOwnPropertyDescriptor(g,y))}),$}});var gg=B((wX,j1)=>{var r=i("fs"),az=wq(),pz=Lq(),lz=Bq(),x$=i("util"),e,w$;if(typeof Symbol==="function"&&typeof Symbol.for==="function")e=Symbol.for("graceful-fs.queue"),w$=Symbol.for("graceful-fs.previous");else e="___graceful-fs.queue",w$="___graceful-fs.previous";function oz(){}function Tq(g,$){Object.defineProperty(g,e,{get:function(){return $}})}var r0=oz;if(x$.debuglog)r0=x$.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))r0=function(){var g=x$.format.apply(x$,arguments);g="GFS4: "+g.split(/\n/).join(`
|
|
3
|
-
GFS4: `),console.error(g)};if(!r[e]){if(V1=global[e]||[],Tq(r,V1),r.close=function(g){function $(y,M){return g.call(r,y,function(q){if(!q)Cq();if(typeof M==="function")M.apply(this,arguments)})}return Object.defineProperty($,w$,{value:g}),$}(r.close),r.closeSync=function(g){function $(y){g.apply(r,arguments),Cq()}return Object.defineProperty($,w$,{value:g}),$}(r.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){r0(r[e]),i("assert").equal(r[e].length,0)})}var V1;if(!global[e])Tq(global,r[e]);j1.exports=m1(lz(r));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!r.__patched)j1.exports=m1(r),r.__patched=!0;function m1(g){az(g),g.gracefulify=m1,g.createReadStream=G0,g.createWriteStream=g0;var $=g.readFile;g.readFile=y;function y(x,E,j){if(typeof E==="function")j=E,E=null;return P(x,E,j);function P(X,D,W,O){return $(X,D,function(_){if(_&&(_.code==="EMFILE"||_.code==="ENFILE"))e0([P,[X,D,W],_,O||Date.now(),Date.now()]);else if(typeof W==="function")W.apply(this,arguments)})}}var M=g.writeFile;g.writeFile=q;function q(x,E,j,P){if(typeof j==="function")P=j,j=null;return X(x,E,j,P);function X(D,W,O,_,T){return M(D,W,O,function(k){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))e0([X,[D,W,O,_],k,T||Date.now(),Date.now()]);else if(typeof _==="function")_.apply(this,arguments)})}}var J=g.appendFile;if(J)g.appendFile=Y;function Y(x,E,j,P){if(typeof j==="function")P=j,j=null;return X(x,E,j,P);function X(D,W,O,_,T){return J(D,W,O,function(k){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))e0([X,[D,W,O,_],k,T||Date.now(),Date.now()]);else if(typeof _==="function")_.apply(this,arguments)})}}var Z=g.copyFile;if(Z)g.copyFile=z;function z(x,E,j,P){if(typeof j==="function")P=j,j=0;return X(x,E,j,P);function X(D,W,O,_,T){return Z(D,W,O,function(k){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))e0([X,[D,W,O,_],k,T||Date.now(),Date.now()]);else if(typeof _==="function")_.apply(this,arguments)})}}var w=g.readdir;g.readdir=L;var K=/^v[0-5]\./;function L(x,E,j){if(typeof E==="function")j=E,E=null;var P=K.test(process.version)?function D(W,O,_,T){return w(W,X(W,O,_,T))}:function D(W,O,_,T){return w(W,O,X(W,O,_,T))};return P(x,E,j);function X(D,W,O,_){return function(T,k){if(T&&(T.code==="EMFILE"||T.code==="ENFILE"))e0([P,[D,W,O],T,_||Date.now(),Date.now()]);else{if(k&&k.sort)k.sort();if(typeof O==="function")O.call(this,T,k)}}}}if(process.version.substr(0,4)==="v0.8"){var C=pz(g);I=C.ReadStream,h=C.WriteStream}var G=g.ReadStream;if(G)I.prototype=Object.create(G.prototype),I.prototype.open=N;var H=g.WriteStream;if(H)h.prototype=Object.create(H.prototype),h.prototype.open=t;Object.defineProperty(g,"ReadStream",{get:function(){return I},set:function(x){I=x},enumerable:!0,configurable:!0}),Object.defineProperty(g,"WriteStream",{get:function(){return h},set:function(x){h=x},enumerable:!0,configurable:!0});var V=I;Object.defineProperty(g,"FileReadStream",{get:function(){return V},set:function(x){V=x},enumerable:!0,configurable:!0});var m=h;Object.defineProperty(g,"FileWriteStream",{get:function(){return m},set:function(x){m=x},enumerable:!0,configurable:!0});function I(x,E){if(this instanceof I)return G.apply(this,arguments),this;else return I.apply(Object.create(I.prototype),arguments)}function N(){var x=this;S(x.path,x.flags,x.mode,function(E,j){if(E){if(x.autoClose)x.destroy();x.emit("error",E)}else x.fd=j,x.emit("open",j),x.read()})}function h(x,E){if(this instanceof h)return H.apply(this,arguments),this;else return h.apply(Object.create(h.prototype),arguments)}function t(){var x=this;S(x.path,x.flags,x.mode,function(E,j){if(E)x.destroy(),x.emit("error",E);else x.fd=j,x.emit("open",j)})}function G0(x,E){return new g.ReadStream(x,E)}function g0(x,E){return new g.WriteStream(x,E)}var $0=g.open;g.open=S;function S(x,E,j,P){if(typeof j==="function")P=j,j=null;return X(x,E,j,P);function X(D,W,O,_,T){return $0(D,W,O,function(k,R){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))e0([X,[D,W,O,_],k,T||Date.now(),Date.now()]);else if(typeof _==="function")_.apply(this,arguments)})}}return g}function e0(g){r0("ENQUEUE",g[0].name,g[1]),r[e].push(g),I1()}var Q$;function Cq(){var g=Date.now();for(var $=0;$<r[e].length;++$)if(r[e][$].length>2)r[e][$][3]=g,r[e][$][4]=g;I1()}function I1(){if(clearTimeout(Q$),Q$=void 0,r[e].length===0)return;var g=r[e].shift(),$=g[0],y=g[1],M=g[2],q=g[3],J=g[4];if(q===void 0)r0("RETRY",$.name,y),$.apply(null,y);else if(Date.now()-q>=60000){r0("TIMEOUT",$.name,y);var Y=y.pop();if(typeof Y==="function")Y.call(null,M)}else{var Z=Date.now()-J,z=Math.max(J-q,1),w=Math.min(z*1.2,100);if(Z>=w)r0("RETRY",$.name,y),$.apply(null,y.concat([q]));else r[e].push(g)}if(Q$===void 0)Q$=setTimeout(I1,0)}});var Z0=B((E1)=>{var kq=p().fromCallback,Y0=gg(),sz=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter((g)=>{return typeof Y0[g]==="function"});Object.assign(E1,Y0);sz.forEach((g)=>{E1[g]=kq(Y0[g])});E1.exists=function(g,$){if(typeof $==="function")return Y0.exists(g,$);return new Promise((y)=>{return Y0.exists(g,y)})};E1.read=function(g,$,y,M,q,J){if(typeof J==="function")return Y0.read(g,$,y,M,q,J);return new Promise((Y,Z)=>{Y0.read(g,$,y,M,q,(z,w,K)=>{if(z)return Z(z);Y({bytesRead:w,buffer:K})})})};E1.write=function(g,$,...y){if(typeof y[y.length-1]==="function")return Y0.write(g,$,...y);return new Promise((M,q)=>{Y0.write(g,$,...y,(J,Y,Z)=>{if(J)return q(J);M({bytesWritten:Y,buffer:Z})})})};E1.readv=function(g,$,...y){if(typeof y[y.length-1]==="function")return Y0.readv(g,$,...y);return new Promise((M,q)=>{Y0.readv(g,$,...y,(J,Y,Z)=>{if(J)return q(J);M({bytesRead:Y,buffers:Z})})})};E1.writev=function(g,$,...y){if(typeof y[y.length-1]==="function")return Y0.writev(g,$,...y);return new Promise((M,q)=>{Y0.writev(g,$,...y,(J,Y,Z)=>{if(J)return q(J);M({bytesWritten:Y,buffers:Z})})})};if(typeof Y0.realpath.native==="function")E1.realpath.native=kq(Y0.realpath.native);else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var Vq=B((JK,Aq)=>{var qK=i("path");JK.checkPath=function g($){if(process.platform==="win32"){if(/[<>:"|?*]/.test($.replace(qK.parse($).root,""))){let M=new Error(`Path contains invalid characters: ${$}`);throw M.code="EINVAL",M}}}});var Eq=B((ZK,F1)=>{var mq=Z0(),{checkPath:Iq}=Vq(),jq=(g)=>{let $={mode:511};if(typeof g==="number")return g;return{...$,...g}.mode};ZK.makeDir=async(g,$)=>{return Iq(g),mq.mkdir(g,{mode:jq($),recursive:!0})};ZK.makeDirSync=(g,$)=>{return Iq(g),mq.mkdirSync(g,{mode:jq($),recursive:!0})}});var P0=B((LX,Fq)=>{var HK=p().fromPromise,{makeDir:DK,makeDirSync:h1}=Eq(),S1=HK(DK);Fq.exports={mkdirs:S1,mkdirsSync:h1,mkdirp:S1,mkdirpSync:h1,ensureDir:S1,ensureDirSync:h1}});var R0=B((PX,Sq)=>{var OK=p().fromPromise,hq=Z0();function XK(g){return hq.access(g).then(()=>!0).catch(()=>!1)}Sq.exports={pathExists:OK(XK),pathExistsSync:hq.existsSync}});var u1=B((BX,uq)=>{var $g=Z0(),GK=p().fromPromise;async function WK(g,$,y){let M=await $g.open(g,"r+"),q=null;try{await $g.futimes(M,$,y)}finally{try{await $g.close(M)}catch(J){q=J}}if(q)throw q}function xK(g,$,y){let M=$g.openSync(g,"r+");return $g.futimesSync(M,$,y),$g.closeSync(M)}uq.exports={utimesMillis:GK(WK),utimesMillisSync:xK}});var f0=B((CX,nq)=>{var yg=Z0(),l=i("path"),Nq=p().fromPromise;function QK(g,$,y){let M=y.dereference?(q)=>yg.stat(q,{bigint:!0}):(q)=>yg.lstat(q,{bigint:!0});return Promise.all([M(g),M($).catch((q)=>{if(q.code==="ENOENT")return null;throw q})]).then(([q,J])=>({srcStat:q,destStat:J}))}function wK(g,$,y){let M,q=y.dereference?(Y)=>yg.statSync(Y,{bigint:!0}):(Y)=>yg.lstatSync(Y,{bigint:!0}),J=q(g);try{M=q($)}catch(Y){if(Y.code==="ENOENT")return{srcStat:J,destStat:null};throw Y}return{srcStat:J,destStat:M}}async function _K(g,$,y,M){let{srcStat:q,destStat:J}=await QK(g,$,M);if(J){if(Ug(q,J)){let Y=l.basename(g),Z=l.basename($);if(y==="move"&&Y!==Z&&Y.toLowerCase()===Z.toLowerCase())return{srcStat:q,destStat:J,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(q.isDirectory()&&!J.isDirectory())throw new Error(`Cannot overwrite non-directory '${$}' with directory '${g}'.`);if(!q.isDirectory()&&J.isDirectory())throw new Error(`Cannot overwrite directory '${$}' with non-directory '${g}'.`)}if(q.isDirectory()&&N1(g,$))throw new Error(_$(g,$,y));return{srcStat:q,destStat:J}}function UK(g,$,y,M){let{srcStat:q,destStat:J}=wK(g,$,M);if(J){if(Ug(q,J)){let Y=l.basename(g),Z=l.basename($);if(y==="move"&&Y!==Z&&Y.toLowerCase()===Z.toLowerCase())return{srcStat:q,destStat:J,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(q.isDirectory()&&!J.isDirectory())throw new Error(`Cannot overwrite non-directory '${$}' with directory '${g}'.`);if(!q.isDirectory()&&J.isDirectory())throw new Error(`Cannot overwrite directory '${$}' with non-directory '${g}'.`)}if(q.isDirectory()&&N1(g,$))throw new Error(_$(g,$,y));return{srcStat:q,destStat:J}}async function Rq(g,$,y,M){let q=l.resolve(l.dirname(g)),J=l.resolve(l.dirname(y));if(J===q||J===l.parse(J).root)return;let Y;try{Y=await yg.stat(J,{bigint:!0})}catch(Z){if(Z.code==="ENOENT")return;throw Z}if(Ug($,Y))throw new Error(_$(g,y,M));return Rq(g,$,J,M)}function bq(g,$,y,M){let q=l.resolve(l.dirname(g)),J=l.resolve(l.dirname(y));if(J===q||J===l.parse(J).root)return;let Y;try{Y=yg.statSync(J,{bigint:!0})}catch(Z){if(Z.code==="ENOENT")return;throw Z}if(Ug($,Y))throw new Error(_$(g,y,M));return bq(g,$,J,M)}function Ug(g,$){return $.ino&&$.dev&&$.ino===g.ino&&$.dev===g.dev}function N1(g,$){let y=l.resolve(g).split(l.sep).filter((q)=>q),M=l.resolve($).split(l.sep).filter((q)=>q);return y.every((q,J)=>M[J]===q)}function _$(g,$,y){return`Cannot ${y} '${g}' to a subdirectory of itself, '${$}'.`}nq.exports={checkPaths:Nq(_K),checkPathsSync:UK,checkParentPaths:Nq(Rq),checkParentPathsSync:bq,isSrcSubdir:N1,areIdentical:Ug}});var dq=B((TX,fq)=>{var M0=Z0(),Lg=i("path"),{mkdirs:LK}=P0(),{pathExists:PK}=R0(),{utimesMillis:BK}=u1(),Pg=f0();async function CK(g,$,y={}){if(typeof y==="function")y={filter:y};if(y.clobber="clobber"in y?!!y.clobber:!0,y.overwrite="overwrite"in y?!!y.overwrite:y.clobber,y.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
1
|
+
var{default:k}=(()=>({}));function y(f){if(typeof f!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify(f))}function Y(f,n){var l="",i=0,v=-1,u=0,A;for(var d=0;d<=f.length;++d){if(d<f.length)A=f.charCodeAt(d);else if(A===47)break;else A=47;if(A===47){if(v===d-1||u===1);else if(v!==d-1&&u===2){if(l.length<2||i!==2||l.charCodeAt(l.length-1)!==46||l.charCodeAt(l.length-2)!==46){if(l.length>2){var C=l.lastIndexOf("/");if(C!==l.length-1){if(C===-1)l="",i=0;else l=l.slice(0,C),i=l.length-1-l.lastIndexOf("/");v=d,u=0;continue}}else if(l.length===2||l.length===1){l="",i=0,v=d,u=0;continue}}if(n){if(l.length>0)l+="/..";else l="..";i=2}}else{if(l.length>0)l+="/"+f.slice(v+1,d);else l=f.slice(v+1,d);i=d-v-1}v=d,u=0}else if(A===46&&u!==-1)++u;else u=-1}return l}function I(f,n){var l=n.dir||n.root,i=n.base||(n.name||"")+(n.ext||"");if(!l)return i;if(l===n.root)return l+i;return l+f+i}function J(){var f="",n=!1,l;for(var i=arguments.length-1;i>=-1&&!n;i--){var v;if(i>=0)v=arguments[i];else{if(l===void 0)l=process.cwd();v=l}if(y(v),v.length===0)continue;f=v+"/"+f,n=v.charCodeAt(0)===47}if(f=Y(f,!n),n)if(f.length>0)return"/"+f;else return"/";else if(f.length>0)return f;else return"."}function Z(f){if(y(f),f.length===0)return".";var n=f.charCodeAt(0)===47,l=f.charCodeAt(f.length-1)===47;if(f=Y(f,!n),f.length===0&&!n)f=".";if(f.length>0&&l)f+="/";if(n)return"/"+f;return f}function F(f){return y(f),f.length>0&&f.charCodeAt(0)===47}function j(){if(arguments.length===0)return".";var f;for(var n=0;n<arguments.length;++n){var l=arguments[n];if(y(l),l.length>0)if(f===void 0)f=l;else f+="/"+l}if(f===void 0)return".";return Z(f)}function O(f,n){if(y(f),y(n),f===n)return"";if(f=J(f),n=J(n),f===n)return"";var l=1;for(;l<f.length;++l)if(f.charCodeAt(l)!==47)break;var i=f.length,v=i-l,u=1;for(;u<n.length;++u)if(n.charCodeAt(u)!==47)break;var A=n.length,d=A-u,C=v<d?v:d,w=-1,b=0;for(;b<=C;++b){if(b===C){if(d>C){if(n.charCodeAt(u+b)===47)return n.slice(u+b+1);else if(b===0)return n.slice(u+b)}else if(v>C){if(f.charCodeAt(l+b)===47)w=b;else if(b===0)w=0}break}var X=f.charCodeAt(l+b),h=n.charCodeAt(u+b);if(X!==h)break;else if(X===47)w=b}var L="";for(b=l+w+1;b<=i;++b)if(b===i||f.charCodeAt(b)===47)if(L.length===0)L+="..";else L+="/..";if(L.length>0)return L+n.slice(u+w);else{if(u+=w,n.charCodeAt(u)===47)++u;return n.slice(u)}}function R(f){return f}function U(f){if(y(f),f.length===0)return".";var n=f.charCodeAt(0),l=n===47,i=-1,v=!0;for(var u=f.length-1;u>=1;--u)if(n=f.charCodeAt(u),n===47){if(!v){i=u;break}}else v=!1;if(i===-1)return l?"/":".";if(l&&i===1)return"//";return f.slice(0,i)}function S(f,n){if(n!==void 0&&typeof n!=="string")throw TypeError('"ext" argument must be a string');y(f);var l=0,i=-1,v=!0,u;if(n!==void 0&&n.length>0&&n.length<=f.length){if(n.length===f.length&&n===f)return"";var A=n.length-1,d=-1;for(u=f.length-1;u>=0;--u){var C=f.charCodeAt(u);if(C===47){if(!v){l=u+1;break}}else{if(d===-1)v=!1,d=u+1;if(A>=0)if(C===n.charCodeAt(A)){if(--A===-1)i=u}else A=-1,i=d}}if(l===i)i=d;else if(i===-1)i=f.length;return f.slice(l,i)}else{for(u=f.length-1;u>=0;--u)if(f.charCodeAt(u)===47){if(!v){l=u+1;break}}else if(i===-1)v=!1,i=u+1;if(i===-1)return"";return f.slice(l,i)}}function x(f){y(f);var n=-1,l=0,i=-1,v=!0,u=0;for(var A=f.length-1;A>=0;--A){var d=f.charCodeAt(A);if(d===47){if(!v){l=A+1;break}continue}if(i===-1)v=!1,i=A+1;if(d===46){if(n===-1)n=A;else if(u!==1)u=1}else if(n!==-1)u=-1}if(n===-1||i===-1||u===0||u===1&&n===i-1&&n===l+1)return"";return f.slice(n,i)}function P(f){if(f===null||typeof f!=="object")throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof f);return I("/",f)}function M(f){y(f);var n={root:"",dir:"",base:"",ext:"",name:""};if(f.length===0)return n;var l=f.charCodeAt(0),i=l===47,v;if(i)n.root="/",v=1;else v=0;var u=-1,A=0,d=-1,C=!0,w=f.length-1,b=0;for(;w>=v;--w){if(l=f.charCodeAt(w),l===47){if(!C){A=w+1;break}continue}if(d===-1)C=!1,d=w+1;if(l===46){if(u===-1)u=w;else if(b!==1)b=1}else if(u!==-1)b=-1}if(u===-1||d===-1||b===0||b===1&&u===d-1&&u===A+1){if(d!==-1)if(A===0&&i)n.base=n.name=f.slice(1,d);else n.base=n.name=f.slice(A,d)}else{if(A===0&&i)n.name=f.slice(1,u),n.base=f.slice(1,d);else n.name=f.slice(A,u),n.base=f.slice(A,d);n.ext=f.slice(u,d)}if(A>0)n.dir=f.slice(0,A-1);else if(i)n.dir="/";return n}var q="/",m=":",r=((f)=>(f.posix=f,f))({resolve:J,normalize:Z,isAbsolute:F,join:j,relative:O,_makeLong:R,dirname:U,basename:S,extname:x,format:P,parse:M,sep:q,delimiter:m,win32:null,posix:null});import*as z from"@stacksjs/path";import{ExitCode as e}from"@stacksjs/types";function $(f){return`\x1B[3m${f}\x1B[23m`}function E(f){return f.replace(/\x1B\[[0-9;]*m/g,"")}class Q{static isTestEnvironment=!1;static shouldExitProcess=!1;static handle(f,n){if(!this.isTestEnvironment)this.shouldExitProcess=n?.shouldExit===!0;if(n?.silent!==!0)this.writeErrorToConsole(f);let l;if(n?.message)l=n.message;else if(f instanceof Error)l=f.message;else if(typeof f==="string")l=f;else l=JSON.stringify(f);let i=Error(l);if(f instanceof Error)Object.assign(i,f);return this.writeErrorToFile(i).catch((v)=>console.error(v)),i}static handleError(f,n){return this.handle(f,n),f}static async writeErrorToFile(f,n){if(!(f instanceof Error)){console.error("Error is not an instance of Error:",f);return}let l=n?` | url=${n.url||"N/A"} method=${n.method||"N/A"} user=${n.userId||"anonymous"}`:"",i=f.stack?`
|
|
2
|
+
${f.stack.split(`
|
|
3
|
+
`).slice(1,4).join(`
|
|
4
|
+
`)}`:"",v=`[${new Date().toISOString()}] ${f.name}: ${f.message}${l}${i}
|
|
5
|
+
`,u=z.logsPath("stacks.log")??z.logsPath("errors.log");try{await k.promises.mkdir(z.dirname(u),{recursive:!0}),await k.promises.appendFile(u,v)}catch(A){console.error("Failed to write to error file:",A)}}static writeErrorToConsole(f){let n;if(f instanceof Error)n=f.message;else if(typeof f==="string")n=f;else n=JSON.stringify(f);if(console.error(n),n.includes("bunx --bun cdk destroy")||n===`Failed to execute command: ${$("bunx --bun eslint . --fix")}`||n===`Failed to execute command: ${$("bun storage/framework/core/actions/src/lint/fix.ts")}`){if(!this.isTestEnvironment)console.log("No need to worry. The edge function is currently being destroyed. Please run `buddy undeploy` shortly again, and continue doing so until it succeeds running."),console.log("Hoping to see you back soon!")}if(this.shouldExitProcess)(void 0)(e.FatalError)}}var g="storage/logs/stacks.log";function v1(f){g=f}async function H(f,n){let i=`[${new Date().toISOString()}] ${f}
|
|
6
|
+
`,v=n?.logFile??g,u=U(v);await k.promises.mkdir(u,{recursive:!0}),await k.promises.appendFile(v,i)}function u1(f,n){let l,i;if(n&&typeof n==="object"&&!("shouldExit"in n)&&!("silent"in n)&&!("message"in n))i=n,n=void 0;let v=f instanceof Error?f.message:typeof f==="string"?f:JSON.stringify(f);if(n&&"message"in n)l=`${v}: ${n.message}`;else l=v;let u=`ERROR: ${E(l)}`;if(i)u+=`
|
|
7
|
+
Context: ${JSON.stringify(i,null,2)}`;H(u).catch((d)=>{console.error("Failed to write error log:",d)});let A=Error(l);if(f instanceof Error)Object.assign(A,f);return Q.handle(A,{...n,message:l})}var G={400:{status:400,title:"Bad Request",message:"The request was malformed or invalid.",docLink:"https://stacksjs.org/docs/errors/400",commonCauses:["JSON body is missing or has a syntax error","A required field is absent from the payload","Content-Type header does not match the body format"],suggestion:"Inspect the request body and Content-Type — most 400s come from malformed JSON or a missing required field."},401:{status:401,title:"Unauthorized",message:"Authentication is required to access this resource.",docLink:"https://stacksjs.org/docs/errors/401",commonCauses:["No Authorization header was sent","The bearer token expired","The session cookie was cleared"],suggestion:"Confirm a valid `Authorization: Bearer <token>` header is sent and the token has not expired."},403:{status:403,title:"Forbidden",message:"You do not have permission to access this resource.",docLink:"https://stacksjs.org/docs/errors/403",commonCauses:["The authenticated user lacks the required ability or role","A Gate or policy denied access (see app/Gates.ts)","The token was issued without the needed ability"],suggestion:"Check Gates / policies and the abilities encoded in the access token."},404:{status:404,title:"Not Found",message:"The requested resource could not be found.",docLink:"https://stacksjs.org/docs/errors/404",commonCauses:["The route is not registered in app/Routes.ts","A typo in the URL path","A model lookup returned no row (ModelNotFoundError)"],suggestion:"Run `buddy route:list` to see registered routes, or verify the model exists with the given id."},405:{status:405,title:"Method Not Allowed",message:"The request method is not supported for this resource.",docLink:"https://stacksjs.org/docs/errors/405",commonCauses:["The route is registered for a different HTTP method","A form posted GET when the route expects POST"],suggestion:"Confirm the HTTP method in `app/Routes.ts` matches what the client sent."},408:{status:408,title:"Request Timeout",message:"The request took too long to complete.",docLink:"https://stacksjs.org/docs/errors/408",commonCauses:["A long-running query or external API call exceeded the timeout","The client uploaded a slow body that stalled"],suggestion:"Move slow work into a queued job, or raise the route timeout if the work is genuinely long."},409:{status:409,title:"Conflict",message:"The request conflicts with the current state of the resource.",docLink:"https://stacksjs.org/docs/errors/409",commonCauses:["A unique-constraint violation (duplicate email, slug, etc.)","Optimistic locking detected a stale write"],suggestion:"Re-fetch the resource and retry, or surface the conflict to the user."},410:{status:410,title:"Gone",message:"The requested resource is no longer available.",docLink:"https://stacksjs.org/docs/errors/410",commonCauses:["The resource was permanently deleted","A signed URL expired"],suggestion:"Issue a fresh signed URL or fall back to the canonical resource."},422:{status:422,title:"Unprocessable Entity",message:"The request was well-formed but could not be processed.",docLink:"https://stacksjs.org/docs/errors/422",commonCauses:["Validation rules from the action / model rejected the payload","A field value is outside the allowed range or shape"],suggestion:"Inspect `errors` in the response body — each key maps to a failing field."},429:{status:429,title:"Too Many Requests",message:"You have exceeded the rate limit.",docLink:"https://stacksjs.org/docs/errors/429",commonCauses:["Rate-limit middleware tripped on this IP / token","A retry loop is hammering the endpoint"],suggestion:"Honor the `Retry-After` response header and back off before retrying."},500:{status:500,title:"Internal Server Error",message:"An unexpected error occurred on the server.",docLink:"https://stacksjs.org/docs/errors/500",commonCauses:["An unhandled exception in an action or middleware","A failing database connection or migration","A misconfigured environment variable"],suggestion:"Check server logs for the original stack trace — the error page above shows the throw site in dev."},502:{status:502,title:"Bad Gateway",message:"The server received an invalid response from an upstream server.",docLink:"https://stacksjs.org/docs/errors/502",commonCauses:["An upstream HTTP API returned a malformed response","A reverse proxy could not reach the origin"],suggestion:"Verify the upstream service is healthy and returning the expected content type."},503:{status:503,title:"Service Unavailable",message:"The service is temporarily unavailable.",docLink:"https://stacksjs.org/docs/errors/503",commonCauses:["Maintenance mode is enabled","A health check is failing","A dependency (db, redis, queue) is down"],suggestion:"Run `buddy doctor` and check dependent services."},504:{status:504,title:"Gateway Timeout",message:"The upstream server did not respond in time.",docLink:"https://stacksjs.org/docs/errors/504",commonCauses:["An upstream HTTP call exceeded its deadline","A long-running database query timed out"],suggestion:"Move the work to a queued job or raise the upstream timeout if the latency is expected."}};var a=["/storage/framework/core/","/node_modules/@stacksjs/","node:internal/","bun:wrap"];function p(f){if(!f)return!1;return a.some((n)=>f.includes(n))}function K(f,n,l={}){if(!f)return[];let i=f.split(`
|
|
8
|
+
`).slice(1),v=[],u=l.includeFrameworkFrames===!0;for(let A of i){let d=A.match(/^\s*at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/);if(d){let C=d[2];if(C===void 0)continue;let w=C;if(n){for(let b of n)if(C.startsWith(b)){C=C.slice(b.length+1);break}}if(!u&&p(w))continue;v.push({function:d[1]||"<anonymous>",file:C,line:parseInt(d[3]??"0",10),column:parseInt(d[4]??"0",10)})}}if(!u&&v.length===0)return K(f,n,{includeFrameworkFrames:!0});return v}function c(f){return f.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function N(f){let n=G[f]||{status:f,title:"Error",message:"An unexpected error occurred."};return`<!DOCTYPE html>
|
|
9
|
+
<html lang="en">
|
|
10
|
+
<head>
|
|
11
|
+
<meta charset="UTF-8">
|
|
12
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
13
|
+
<title>${n.status} - ${n.title}</title>
|
|
14
|
+
<style>
|
|
15
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
16
|
+
body {
|
|
17
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
|
|
18
|
+
line-height: 1.6;
|
|
19
|
+
color: #1a1a2e;
|
|
20
|
+
background: #f8f9fa;
|
|
21
|
+
}
|
|
22
|
+
.dark body { background: #1a1a2e; color: #e8e8e8; }
|
|
23
|
+
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
|
|
24
|
+
.error-header {
|
|
25
|
+
background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
|
|
26
|
+
color: white;
|
|
27
|
+
padding: 2rem;
|
|
28
|
+
border-radius: 12px;
|
|
29
|
+
margin-bottom: 1.5rem;
|
|
30
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
31
|
+
}
|
|
32
|
+
.error-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
|
|
33
|
+
.error-message { font-size: 1.1rem; opacity: 0.9; word-break: break-word; }
|
|
34
|
+
.error-status { font-size: 0.875rem; opacity: 0.75; margin-top: 0.5rem; }
|
|
35
|
+
.card {
|
|
36
|
+
background: white;
|
|
37
|
+
border-radius: 12px;
|
|
38
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
|
39
|
+
margin-bottom: 1.5rem;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
}
|
|
42
|
+
.dark .card { background: #252540; }
|
|
43
|
+
.card-header {
|
|
44
|
+
padding: 1rem 1.5rem;
|
|
45
|
+
border-bottom: 1px solid #e9ecef;
|
|
46
|
+
font-weight: 600;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: 0.5rem;
|
|
50
|
+
}
|
|
51
|
+
.dark .card-header { border-bottom-color: #3a3a5a; }
|
|
52
|
+
.card-body { padding: 1.5rem; }
|
|
53
|
+
.stack-frame {
|
|
54
|
+
padding: 1rem 1.5rem;
|
|
55
|
+
border-bottom: 1px solid #e9ecef;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
transition: background 0.2s;
|
|
58
|
+
}
|
|
59
|
+
.stack-frame:hover { background: #f8f9fa; }
|
|
60
|
+
.dark .stack-frame:hover { background: #1a1a2e; }
|
|
61
|
+
.stack-frame:last-child { border-bottom: none; }
|
|
62
|
+
.stack-frame.expanded { background: #f8f9fa; }
|
|
63
|
+
.dark .stack-frame.expanded { background: #1a1a2e; }
|
|
64
|
+
.frame-file { font-family: 'Monaco', 'Menlo', monospace; font-size: 0.875rem; color: #6c757d; }
|
|
65
|
+
.frame-function { font-weight: 500; color: #495057; }
|
|
66
|
+
.dark .frame-function { color: #e8e8e8; }
|
|
67
|
+
.frame-line { color: #dc3545; font-weight: 600; }
|
|
68
|
+
.code-snippet {
|
|
69
|
+
background: #282c34;
|
|
70
|
+
color: #abb2bf;
|
|
71
|
+
padding: 1rem;
|
|
72
|
+
margin-top: 0.5rem;
|
|
73
|
+
border-radius: 8px;
|
|
74
|
+
overflow-x: auto;
|
|
75
|
+
font-family: 'Monaco', 'Menlo', monospace;
|
|
76
|
+
font-size: 0.8125rem;
|
|
77
|
+
line-height: 1.8;
|
|
78
|
+
}
|
|
79
|
+
.code-line { display: flex; }
|
|
80
|
+
.code-line-number {
|
|
81
|
+
width: 3rem;
|
|
82
|
+
text-align: right;
|
|
83
|
+
padding-right: 1rem;
|
|
84
|
+
color: #636d83;
|
|
85
|
+
user-select: none;
|
|
86
|
+
}
|
|
87
|
+
.code-line-content { flex: 1; }
|
|
88
|
+
.code-line.highlight { background: rgba(220, 53, 69, 0.2); }
|
|
89
|
+
.code-line.highlight .code-line-number { color: #dc3545; }
|
|
90
|
+
.info-table { width: 100%; border-collapse: collapse; }
|
|
91
|
+
.info-table td { padding: 0.75rem 0; border-bottom: 1px solid #e9ecef; }
|
|
92
|
+
.dark .info-table td { border-bottom-color: #3a3a5a; }
|
|
93
|
+
.info-table td:first-child { font-weight: 500; width: 30%; color: #6c757d; }
|
|
94
|
+
.info-table tr:last-child td { border-bottom: none; }
|
|
95
|
+
.query-item {
|
|
96
|
+
padding: 1rem;
|
|
97
|
+
background: #f8f9fa;
|
|
98
|
+
border-radius: 8px;
|
|
99
|
+
margin-bottom: 0.75rem;
|
|
100
|
+
font-family: 'Monaco', 'Menlo', monospace;
|
|
101
|
+
font-size: 0.8125rem;
|
|
102
|
+
}
|
|
103
|
+
.dark .query-item { background: #1a1a2e; }
|
|
104
|
+
.query-time { color: #6c757d; font-size: 0.75rem; margin-top: 0.5rem; }
|
|
105
|
+
.badge {
|
|
106
|
+
display: inline-block;
|
|
107
|
+
padding: 0.25rem 0.5rem;
|
|
108
|
+
border-radius: 4px;
|
|
109
|
+
font-size: 0.75rem;
|
|
110
|
+
font-weight: 500;
|
|
111
|
+
}
|
|
112
|
+
.badge-method { background: #e7f5ff; color: #1971c2; }
|
|
113
|
+
.dark .badge-method { background: #1971c2; color: white; }
|
|
114
|
+
.production-page {
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: column;
|
|
117
|
+
align-items: center;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
min-height: 100vh;
|
|
120
|
+
text-align: center;
|
|
121
|
+
padding: 2rem;
|
|
122
|
+
}
|
|
123
|
+
.production-status { font-size: 6rem; font-weight: 700; color: #dee2e6; margin-bottom: 1rem; }
|
|
124
|
+
.production-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
|
|
125
|
+
.production-message { color: #6c757d; margin-bottom: 2rem; }
|
|
126
|
+
.production-link { color: #0d6efd; text-decoration: none; }
|
|
127
|
+
.production-link:hover { text-decoration: underline; }
|
|
128
|
+
.error-hint {
|
|
129
|
+
border-left: 4px solid #f59f00;
|
|
130
|
+
background: #fff9db;
|
|
131
|
+
}
|
|
132
|
+
.dark .error-hint, .auto .error-hint { background: #2b2410; border-left-color: #f59f00; }
|
|
133
|
+
.error-hint .card-header { color: #845200; }
|
|
134
|
+
.dark .error-hint .card-header, .auto .error-hint .card-header { color: #ffd43b; }
|
|
135
|
+
.error-hint-causes { margin: 0 0 0.75rem 1.25rem; padding: 0; }
|
|
136
|
+
.error-hint-causes li { margin: 0.2rem 0; }
|
|
137
|
+
.error-hint-suggestion { font-weight: 500; margin-bottom: 0.75rem; }
|
|
138
|
+
.error-hint-doc { color: #0d6efd; text-decoration: none; }
|
|
139
|
+
.error-hint-doc:hover { text-decoration: underline; }
|
|
140
|
+
@media (prefers-color-scheme: dark) {
|
|
141
|
+
.auto body { background: #1a1a2e; color: #e8e8e8; }
|
|
142
|
+
.auto .card { background: #252540; }
|
|
143
|
+
.auto .card-header { border-bottom-color: #3a3a5a; }
|
|
144
|
+
.auto .stack-frame:hover { background: #1a1a2e; }
|
|
145
|
+
.auto .stack-frame.expanded { background: #1a1a2e; }
|
|
146
|
+
.auto .frame-function { color: #e8e8e8; }
|
|
147
|
+
.auto .info-table td { border-bottom-color: #3a3a5a; }
|
|
148
|
+
.auto .query-item { background: #1a1a2e; }
|
|
149
|
+
.auto .badge-method { background: #1971c2; color: white; }
|
|
150
|
+
}
|
|
151
|
+
</style>
|
|
152
|
+
</head>
|
|
153
|
+
<body>
|
|
154
|
+
<div class="production-page">
|
|
155
|
+
<div class="production-status">${n.status}</div>
|
|
156
|
+
<h1 class="production-title">${c(n.title)}</h1>
|
|
157
|
+
<p class="production-message">${c(n.message)}</p>
|
|
158
|
+
<a href="/" class="production-link">← Back to Home</a>
|
|
159
|
+
</div>
|
|
160
|
+
</body>
|
|
161
|
+
</html>`}function o(f){let n=G[f];if(!n)return"";let l=Array.isArray(n.commonCauses)&&n.commonCauses.length>0,i=typeof n.suggestion==="string"&&n.suggestion.length>0,v=typeof n.docLink==="string"&&n.docLink.length>0;if(!l&&!i&&!v)return"";let u=l?`<ul class="error-hint-causes">${n.commonCauses.map((C)=>`<li>${c(C)}</li>`).join("")}</ul>`:"",A=i?`<p class="error-hint-suggestion">${c(n.suggestion)}</p>`:"",d=v?`<a class="error-hint-doc" href="${c(n.docLink)}" target="_blank" rel="noreferrer noopener">Read the docs →</a>`:"";return`<section class="error-hint card">
|
|
162
|
+
<div class="card-header">Likely causes & next steps</div>
|
|
163
|
+
<div class="card-body">${u}${A}${d}</div>
|
|
164
|
+
</section>`}class W{config;framework;request;routing;user;queries=[];constructor(f){this.config={appName:"App",theme:"auto",showEnvironment:!0,showQueries:!0,showRequest:!0,enableCopyMarkdown:!0,snippetLines:8,...f}}setFramework(f,n){return this.framework={name:f,version:n},this}setRequest(f){if(f instanceof Request){let n=new URL(f.url);this.request={method:f.method,url:f.url,headers:Object.fromEntries(f.headers.entries()),queryParams:Object.fromEntries(n.searchParams.entries())}}else this.request=f;return this}setRouting(f){return this.routing=f,this}setUser(f){return this.user=f,this}addQuery(f,n,l){return this.queries.push({query:f,time:n,connection:l}),this}render(f,n=500){let l=K(f.stack,this.config.basePaths,{includeFrameworkFrames:this.config.showFrameworkFrames===!0});return`<!DOCTYPE html>
|
|
165
|
+
<html lang="en" class="${this.config.theme||"auto"}">
|
|
166
|
+
<head>
|
|
167
|
+
<meta charset="UTF-8">
|
|
168
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
169
|
+
<title>${n} - ${c(f.name||"Error")}</title>
|
|
170
|
+
<style>
|
|
171
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
172
|
+
body {
|
|
173
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
|
|
174
|
+
line-height: 1.6;
|
|
175
|
+
color: #1a1a2e;
|
|
176
|
+
background: #f8f9fa;
|
|
177
|
+
}
|
|
178
|
+
.dark body { background: #1a1a2e; color: #e8e8e8; }
|
|
179
|
+
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
|
|
180
|
+
.error-header {
|
|
181
|
+
background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
|
|
182
|
+
color: white;
|
|
183
|
+
padding: 2rem;
|
|
184
|
+
border-radius: 12px;
|
|
185
|
+
margin-bottom: 1.5rem;
|
|
186
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
187
|
+
}
|
|
188
|
+
.error-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
|
|
189
|
+
.error-message { font-size: 1.1rem; opacity: 0.9; word-break: break-word; }
|
|
190
|
+
.error-status { font-size: 0.875rem; opacity: 0.75; margin-top: 0.5rem; }
|
|
191
|
+
.card {
|
|
192
|
+
background: white;
|
|
193
|
+
border-radius: 12px;
|
|
194
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
|
195
|
+
margin-bottom: 1.5rem;
|
|
196
|
+
overflow: hidden;
|
|
197
|
+
}
|
|
198
|
+
.dark .card { background: #252540; }
|
|
199
|
+
.card-header {
|
|
200
|
+
padding: 1rem 1.5rem;
|
|
201
|
+
border-bottom: 1px solid #e9ecef;
|
|
202
|
+
font-weight: 600;
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
gap: 0.5rem;
|
|
206
|
+
}
|
|
207
|
+
.dark .card-header { border-bottom-color: #3a3a5a; }
|
|
208
|
+
.card-body { padding: 1.5rem; }
|
|
209
|
+
.stack-frame {
|
|
210
|
+
padding: 1rem 1.5rem;
|
|
211
|
+
border-bottom: 1px solid #e9ecef;
|
|
212
|
+
cursor: pointer;
|
|
213
|
+
transition: background 0.2s;
|
|
214
|
+
}
|
|
215
|
+
.stack-frame:hover { background: #f8f9fa; }
|
|
216
|
+
.dark .stack-frame:hover { background: #1a1a2e; }
|
|
217
|
+
.stack-frame:last-child { border-bottom: none; }
|
|
218
|
+
.stack-frame.expanded { background: #f8f9fa; }
|
|
219
|
+
.dark .stack-frame.expanded { background: #1a1a2e; }
|
|
220
|
+
.frame-file { font-family: 'Monaco', 'Menlo', monospace; font-size: 0.875rem; color: #6c757d; }
|
|
221
|
+
.frame-function { font-weight: 500; color: #495057; }
|
|
222
|
+
.dark .frame-function { color: #e8e8e8; }
|
|
223
|
+
.frame-line { color: #dc3545; font-weight: 600; }
|
|
224
|
+
.code-snippet {
|
|
225
|
+
background: #282c34;
|
|
226
|
+
color: #abb2bf;
|
|
227
|
+
padding: 1rem;
|
|
228
|
+
margin-top: 0.5rem;
|
|
229
|
+
border-radius: 8px;
|
|
230
|
+
overflow-x: auto;
|
|
231
|
+
font-family: 'Monaco', 'Menlo', monospace;
|
|
232
|
+
font-size: 0.8125rem;
|
|
233
|
+
line-height: 1.8;
|
|
234
|
+
}
|
|
235
|
+
.code-line { display: flex; }
|
|
236
|
+
.code-line-number {
|
|
237
|
+
width: 3rem;
|
|
238
|
+
text-align: right;
|
|
239
|
+
padding-right: 1rem;
|
|
240
|
+
color: #636d83;
|
|
241
|
+
user-select: none;
|
|
242
|
+
}
|
|
243
|
+
.code-line-content { flex: 1; }
|
|
244
|
+
.code-line.highlight { background: rgba(220, 53, 69, 0.2); }
|
|
245
|
+
.code-line.highlight .code-line-number { color: #dc3545; }
|
|
246
|
+
.info-table { width: 100%; border-collapse: collapse; }
|
|
247
|
+
.info-table td { padding: 0.75rem 0; border-bottom: 1px solid #e9ecef; }
|
|
248
|
+
.dark .info-table td { border-bottom-color: #3a3a5a; }
|
|
249
|
+
.info-table td:first-child { font-weight: 500; width: 30%; color: #6c757d; }
|
|
250
|
+
.info-table tr:last-child td { border-bottom: none; }
|
|
251
|
+
.query-item {
|
|
252
|
+
padding: 1rem;
|
|
253
|
+
background: #f8f9fa;
|
|
254
|
+
border-radius: 8px;
|
|
255
|
+
margin-bottom: 0.75rem;
|
|
256
|
+
font-family: 'Monaco', 'Menlo', monospace;
|
|
257
|
+
font-size: 0.8125rem;
|
|
258
|
+
}
|
|
259
|
+
.dark .query-item { background: #1a1a2e; }
|
|
260
|
+
.query-time { color: #6c757d; font-size: 0.75rem; margin-top: 0.5rem; }
|
|
261
|
+
.badge {
|
|
262
|
+
display: inline-block;
|
|
263
|
+
padding: 0.25rem 0.5rem;
|
|
264
|
+
border-radius: 4px;
|
|
265
|
+
font-size: 0.75rem;
|
|
266
|
+
font-weight: 500;
|
|
267
|
+
}
|
|
268
|
+
.badge-method { background: #e7f5ff; color: #1971c2; }
|
|
269
|
+
.dark .badge-method { background: #1971c2; color: white; }
|
|
270
|
+
.production-page {
|
|
271
|
+
display: flex;
|
|
272
|
+
flex-direction: column;
|
|
273
|
+
align-items: center;
|
|
274
|
+
justify-content: center;
|
|
275
|
+
min-height: 100vh;
|
|
276
|
+
text-align: center;
|
|
277
|
+
padding: 2rem;
|
|
278
|
+
}
|
|
279
|
+
.production-status { font-size: 6rem; font-weight: 700; color: #dee2e6; margin-bottom: 1rem; }
|
|
280
|
+
.production-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
|
|
281
|
+
.production-message { color: #6c757d; margin-bottom: 2rem; }
|
|
282
|
+
.production-link { color: #0d6efd; text-decoration: none; }
|
|
283
|
+
.production-link:hover { text-decoration: underline; }
|
|
284
|
+
.error-hint {
|
|
285
|
+
border-left: 4px solid #f59f00;
|
|
286
|
+
background: #fff9db;
|
|
287
|
+
}
|
|
288
|
+
.dark .error-hint, .auto .error-hint { background: #2b2410; border-left-color: #f59f00; }
|
|
289
|
+
.error-hint .card-header { color: #845200; }
|
|
290
|
+
.dark .error-hint .card-header, .auto .error-hint .card-header { color: #ffd43b; }
|
|
291
|
+
.error-hint-causes { margin: 0 0 0.75rem 1.25rem; padding: 0; }
|
|
292
|
+
.error-hint-causes li { margin: 0.2rem 0; }
|
|
293
|
+
.error-hint-suggestion { font-weight: 500; margin-bottom: 0.75rem; }
|
|
294
|
+
.error-hint-doc { color: #0d6efd; text-decoration: none; }
|
|
295
|
+
.error-hint-doc:hover { text-decoration: underline; }
|
|
296
|
+
@media (prefers-color-scheme: dark) {
|
|
297
|
+
.auto body { background: #1a1a2e; color: #e8e8e8; }
|
|
298
|
+
.auto .card { background: #252540; }
|
|
299
|
+
.auto .card-header { border-bottom-color: #3a3a5a; }
|
|
300
|
+
.auto .stack-frame:hover { background: #1a1a2e; }
|
|
301
|
+
.auto .stack-frame.expanded { background: #1a1a2e; }
|
|
302
|
+
.auto .frame-function { color: #e8e8e8; }
|
|
303
|
+
.auto .info-table td { border-bottom-color: #3a3a5a; }
|
|
304
|
+
.auto .query-item { background: #1a1a2e; }
|
|
305
|
+
.auto .badge-method { background: #1971c2; color: white; }
|
|
306
|
+
}
|
|
307
|
+
</style>
|
|
308
|
+
</head>
|
|
309
|
+
<body>
|
|
310
|
+
<div class="container">
|
|
311
|
+
<div class="error-header">
|
|
312
|
+
<div class="error-title">${c(f.name||"Error")}</div>
|
|
313
|
+
<div class="error-message">${c(f.message)}</div>
|
|
314
|
+
<div class="error-status">${n} • ${this.framework?`${this.framework.name}${this.framework.version?` v${this.framework.version}`:""}`:"Application"}</div>
|
|
315
|
+
</div>
|
|
4
316
|
|
|
5
|
-
|
|
317
|
+
${o(n)}
|
|
6
318
|
|
|
7
|
-
|
|
8
|
-
`,finalEOL:y=!0,replacer:M=null,spaces:q}={}){let J=y?$:"";return JSON.stringify(g,M,q).replace(/\n/g,$)+J}function U4(g){if(Buffer.isBuffer(g))g=g.toString("utf8");return g.replace(/^\uFEFF/,"")}h9.exports={stringify:_4,stripBom:U4}});var R9=B((NX,N9)=>{var Mg;try{Mg=gg()}catch(g){Mg=i("fs")}var P$=p(),{stringify:S9,stripBom:u9}=L$();async function L4(g,$={}){if(typeof $==="string")$={encoding:$};let y=$.fs||Mg,M="throws"in $?$.throws:!0,q=await P$.fromCallback(y.readFile)(g,$);q=u9(q);let J;try{J=JSON.parse(q,$?$.reviver:null)}catch(Y){if(M)throw Y.message=`${g}: ${Y.message}`,Y;else return null}return J}var P4=P$.fromPromise(L4);function B4(g,$={}){if(typeof $==="string")$={encoding:$};let y=$.fs||Mg,M="throws"in $?$.throws:!0;try{let q=y.readFileSync(g,$);return q=u9(q),JSON.parse(q,$.reviver)}catch(q){if(M)throw q.message=`${g}: ${q.message}`,q;else return null}}async function C4(g,$,y={}){let M=y.fs||Mg,q=S9($,y);await P$.fromCallback(M.writeFile)(g,q,y)}var T4=P$.fromPromise(C4);function k4(g,$,y={}){let M=y.fs||Mg,q=S9($,y);return M.writeFileSync(g,q,y)}var A4={readFile:P4,readFileSync:B4,writeFile:T4,writeFileSync:k4};N9.exports=A4});var n9=B((RX,b9)=>{var B$=R9();b9.exports={readJson:B$.readFile,readJsonSync:B$.readFileSync,writeJson:B$.writeFile,writeJsonSync:B$.writeFileSync}});var C$=B((bX,r9)=>{var V4=p().fromPromise,b1=Z0(),c9=i("path"),v9=P0(),m4=R0().pathExists;async function I4(g,$,y="utf-8"){let M=c9.dirname(g);if(!await m4(M))await v9.mkdirs(M);return b1.writeFile(g,$,y)}function j4(g,...$){let y=c9.dirname(g);if(!b1.existsSync(y))v9.mkdirsSync(y);b1.writeFileSync(g,...$)}r9.exports={outputFile:V4(I4),outputFileSync:j4}});var d9=B((nX,f9)=>{var{stringify:E4}=L$(),{outputFile:F4}=C$();async function h4(g,$,y={}){let M=E4($,y);await F4(g,M,y)}f9.exports=h4});var i9=B((cX,t9)=>{var{stringify:S4}=L$(),{outputFileSync:u4}=C$();function N4(g,$,y){let M=S4($,y);u4(g,M,y)}t9.exports=N4});var p9=B((vX,a9)=>{var R4=p().fromPromise,K0=n9();K0.outputJson=R4(d9());K0.outputJsonSync=i9();K0.outputJSON=K0.outputJson;K0.outputJSONSync=K0.outputJsonSync;K0.writeJSON=K0.writeJson;K0.writeJSONSync=K0.writeJsonSync;K0.readJSON=K0.readJson;K0.readJSONSync=K0.readJsonSync;a9.exports=K0});var gJ=B((rX,e9)=>{var b4=Z0(),l9=i("path"),{copy:n4}=U$(),{remove:s9}=Tg(),{mkdirp:c4}=P0(),{pathExists:v4}=R0(),o9=f0();async function r4(g,$,y={}){let M=y.overwrite||y.clobber||!1,{srcStat:q,isChangingCase:J=!1}=await o9.checkPaths(g,$,"move",y);await o9.checkParentPaths(g,q,$,"move");let Y=l9.dirname($);if(l9.parse(Y).root!==Y)await c4(Y);return f4(g,$,M,J)}async function f4(g,$,y,M){if(!M){if(y)await s9($);else if(await v4($))throw new Error("dest already exists.")}try{await b4.rename(g,$)}catch(q){if(q.code!=="EXDEV")throw q;await d4(g,$,y)}}async function d4(g,$,y){return await n4(g,$,{overwrite:y,errorOnExist:!0,preserveTimestamps:!0}),s9(g)}e9.exports=r4});var JJ=B((fX,qJ)=>{var yJ=gg(),c1=i("path"),t4=U$().copySync,MJ=Tg().removeSync,i4=P0().mkdirpSync,$J=f0();function a4(g,$,y){y=y||{};let M=y.overwrite||y.clobber||!1,{srcStat:q,isChangingCase:J=!1}=$J.checkPathsSync(g,$,"move",y);if($J.checkParentPathsSync(g,q,$,"move"),!p4($))i4(c1.dirname($));return l4(g,$,M,J)}function p4(g){let $=c1.dirname(g);return c1.parse($).root===$}function l4(g,$,y,M){if(M)return n1(g,$,y);if(y)return MJ($),n1(g,$,y);if(yJ.existsSync($))throw new Error("dest already exists.");return n1(g,$,y)}function n1(g,$,y){try{yJ.renameSync(g,$)}catch(M){if(M.code!=="EXDEV")throw M;return o4(g,$,y)}}function o4(g,$,y){return t4(g,$,{overwrite:y,errorOnExist:!0,preserveTimestamps:!0}),MJ(g)}qJ.exports=a4});var ZJ=B((dX,YJ)=>{var s4=p().fromPromise;YJ.exports={move:s4(gJ()),moveSync:JJ()}});var KJ=B((tX,zJ)=>{zJ.exports={...Z0(),...U$(),...Z9(),...F9(),...p9(),...P0(),...ZJ(),...C$(),...R0(),...Tg()}});import{appendFile as DJ,mkdir as OJ}from"node:fs/promises";import{dirname as e4}from"node:path";import gH from"node:process";import{italic as HJ,stripAnsi as $H}from"@stacksjs/cli";import*as Ag from"@stacksjs/path";var SJ=new Set([".","!","?"]),BH=new Set([...SJ,":",'"',"'","”"]);var m$=[],I$=[],r1={},qg={},Jg={};function f1(g){return typeof g==="string"?new RegExp(`^${g}$`,"i"):g}function Fg(g,$){if(g===$)return $;if(g===g.toLowerCase())return $.toLowerCase();if(g===g.toUpperCase())return $.toUpperCase();if(g[0]===g[0].toUpperCase())return $.charAt(0).toUpperCase()+$.slice(1).toLowerCase();return $.toLowerCase()}function NJ(g,...$){return g.replace(/\$(\d{1,2})/g,(y,M)=>$[Number(M)]||"")}function RJ(g,$){return g.replace($[0],(...y)=>{let M=NJ($[1],...y);if(y[0]==="")return Fg(g[y[y.length-2]-1],M);return Fg(y[0],M)})}function d1(g,$,y){if(!g.length||r1[g])return $;for(let M=y.length-1;M>=0;M--){let q=y[M];if(q[0].test($))return RJ($,q)}return $}function t1(g,$,y){return(M)=>{let q=M.toLowerCase();if($[q])return Fg(M,q);if(g[q])return Fg(M,g[q]);return d1(q,M,y)}}function i1(g,$,y){return(M)=>{let q=M.toLowerCase();if($[q])return!0;if(g[q])return!1;return d1(q,q,y)===q}}var y0=(g,$={})=>{let{count:y=2,inclusive:M=!1}=$;if(typeof g!=="string")throw new TypeError("Word must be a string");let q=y===1?y0.singular(g):y0.plural(g);return M?`${y} ${q}`:q};y0.plural=t1(Jg,qg,m$);y0.isPlural=i1(Jg,qg,m$);y0.singular=t1(qg,Jg,I$);y0.isSingular=i1(qg,Jg,I$);y0.addPluralRule=(g,$)=>{m$.push([f1(g),$])};y0.addSingularRule=(g,$)=>{I$.push([f1(g),$])};y0.addUncountableRule=(g)=>{if(typeof g==="string"){r1[g.toLowerCase()]=!0;return}y0.addPluralRule(g,"$0"),y0.addSingularRule(g,"$0")};y0.addIrregularRule=(g,$)=>{let y=$.toLowerCase(),M=g.toLowerCase();Jg[M]=y,qg[y]=M};[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["my","our"],["its","their"],["his","their"],["her","their"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"],["canvas","canvases"]].forEach(([g,$])=>y0.addIrregularRule(g,$));[[/s?$/i,"s"],[/[^\x20-\x7F]$/,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(([g,$])=>y0.addPluralRule(g,$));[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|\W|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/(dg|ss|ois|lk|ok|wn|mb|th|ch|ec|oal|is|ck|ix|sser|ts|wb)ies$/i,"$1ie"],[/\b(l|(?:neck|cross|hog|aun)?t|coll|faer|food|gen|goon|group|hipp|junk|vegg|(?:pork)?p|charl|calor|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(([g,$])=>y0.addSingularRule(g,$));["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(y0.addUncountableRule);var IH=JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E\'","Ը":"Y\'","Թ":"T\'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C\'","Կ":"K","Հ":"H","Ձ":"D\'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R\'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P\'","Ք":"Q\'","Օ":"O\'\'","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"\'","’":"\'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}'),jH=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function a1(g){return typeof g==="string"}var rJ=Object.defineProperty,hg=(g,$)=>{for(var y in $)rJ(g,y,{get:$[y],enumerable:!0})};var ay=u(l1(),1),py=u(Ng(),1),ly=u($y(),1),oy=u(Yy(),1),sy=u(Zy(),1),ey=u(Hy(),1),gM=u(Dy(),1),$M=u(Oy(),1),yM=u(Wy(),1),MM=u(ky(),1),qM=u(Vy(),1),JM=u(Ey(),1),YM=u(Fy(),1),ZM=u(uy(),1),zM=u(by(),1),KM=u(cy(),1),HM=u(J1(),1),DM=u(Y1(),1),OM=u(Y1(),1),XM=u(J1(),1),Gg=class{#g;#$;constructor(g,$){this.#g=g,this.#$=$||{}}#y(g,$){if(!g.includes("{{"))return g;return g.replace(/(\\)?{{(.*?)}}/g,(y,M,q)=>{let J=q.trim().split("."),Y=$;while(J.length){if(Y===null||typeof Y!=="object")return;let Z=J.shift();Y=Object.hasOwn(Y,Z)?Y[Z]:void 0}return Y})}getMessage(g,$,y,M){let q=this.#$[y.name]||y.name,J=this.#g[`${y.getFieldPath()}.${$}`];if(J)return this.#y(J,{field:q,...M});let Y=this.#g[`${y.wildCardPath}.${$}`];if(Y)return this.#y(Y,{field:q,...M});let Z=this.#g[$];if(Z)return this.#y(Z,{field:q,...M});return this.#y(g,{field:q,...M})}toJSON(){return{messages:this.#g,fields:this.#$}}},q$={};hg(q$,{E_VALIDATION_ERROR:()=>iy});var Z1=class extends Error{constructor(g,$){super("Validation failure",$);this.messages=g;let y=this.constructor;if("captureStackTrace"in Error)Error.captureStackTrace(this,y)}status=422;code="E_VALIDATION_ERROR";get[Symbol.toStringTag](){return this.constructor.name}toString(){return`${this.name} [${this.code}]: ${this.message}`}},iy=Z1,z1=class{hasErrors=!1;errors=[];report(g,$,y,M){let q={message:g,rule:$,field:y.getFieldPath()};if(M)q.meta=M;if(y.isArrayMember)q.index=y.name;this.hasErrors=!0,this.errors.push(q)}createError(){return new iy(this.errors)}},U6=["1",1,"true",!0,"on"],L6=["0",0,"false",!1],P6=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,A={exists(g){return g!==null&&g!==void 0},isMissing(g){return!this.exists(g)},isTrue(g){return U6.includes(g)},isFalse(g){return L6.includes(g)},isString(g){return typeof g==="string"},isObject(g){return!!(g&&typeof g==="object"&&!Array.isArray(g))},hasKeys(g,$){for(let y of $)if(y in g===!1)return!1;return!0},isArray(g){return Array.isArray(g)},isNumeric(g){return!Number.isNaN(Number(g))},asNumber(g){return g===null?Number.NaN:Number(g)},asBoolean(g){if(this.isTrue(g))return!0;if(this.isFalse(g))return!1;return null},isEmail:yM.default.default,isURL:oy.default.default,isAlpha:MM.default.default,isAlphaNumeric:zM.default.default,isIP:py.default.default,isUUID:gM.default.default,isAscii:$M.default.default,isCreditCard:ZM.default.default,isIBAN:ey.default.default,isJWT:ly.default.default,isLatLong:qM.default.default,isMobilePhone:DM.default.default,isPassportNumber:KM.default.default,isPostalCode:HM.default.default,isSlug:sy.default.default,isDecimal:JM.default.default,mobileLocales:OM.locales,postalCountryCodes:XM.locales,passportCountryCodes:["AM","AR","AT","AU","AZ","BE","BG","BR","BY","CA","CH","CY","CZ","DE","DK","DZ","ES","FI","FR","GB","GR","HR","HU","IE","IN","ID","IR","IS","IT","JM","JP","KR","KZ","LI","LT","LU","LV","LY","MT","MZ","MY","MX","NL","NZ","PH","PK","PL","PT","RO","RU","SE","SL","SK","TH","TR","UA","US"],isULID(g){if(typeof g!=="string")return!1;if(g[0]>"7")return!1;return P6.test(g)},isHexColor:(g)=>{if(!g.startsWith("#"))return!1;return YM.default.default(g)},isActiveURL:async(g)=>{let{resolve4:$,resolve6:y}=await import("node:dns/promises");try{let{hostname:M}=new URL(g);if((await y(M)).length)return!0;else return(await $(M)).length>0}catch{return!1}},isDistinct:(g,$)=>{let y=new Set;if(!$){for(let q of g)if(A.exists(q))if(y.has(q))return!1;else y.add(q);return!0}let M=Array.isArray($)?$:[$];for(let q of g)if(A.isObject(q)&&A.hasKeys(q,M)){let J=M.map((Y)=>q[Y]).join("_");if(y.has(J))return!1;else y.add(J)}return!0},getNestedValue(g,$){if(g.indexOf(".")>-1)return ay.default($.data,g);return $.parent[g]}};var Q={required:"The {{ field }} field must be defined",string:"The {{ field }} field must be a string",email:"The {{ field }} field must be a valid email address",mobile:"The {{ field }} field must be a valid mobile phone number",creditCard:"The {{ field }} field must be a valid {{ providersList }} card number",passport:"The {{ field }} field must be a valid passport number",postalCode:"The {{ field }} field must be a valid postal code",regex:"The {{ field }} field format is invalid",ascii:"The {{ field }} field must only contain ASCII characters",iban:"The {{ field }} field must be a valid IBAN number",jwt:"The {{ field }} field must be a valid JWT token",coordinates:"The {{ field }} field must contain latitude and longitude coordinates",url:"The {{ field }} field must be a valid URL",activeUrl:"The {{ field }} field must be a valid URL",alpha:"The {{ field }} field must contain only letters",alphaNumeric:"The {{ field }} field must contain only letters and numbers",minLength:"The {{ field }} field must have at least {{ min }} characters",maxLength:"The {{ field }} field must not be greater than {{ max }} characters",fixedLength:"The {{ field }} field must be {{ size }} characters long",confirmed:"The {{ field }} field and {{ otherField }} field must be the same",endsWith:"The {{ field }} field must end with {{ substring }}",startsWith:"The {{ field }} field must start with {{ substring }}",sameAs:"The {{ field }} field and {{ otherField }} field must be the same",notSameAs:"The {{ field }} field and {{ otherField }} field must be different",in:"The selected {{ field }} is invalid",notIn:"The selected {{ field }} is invalid",ipAddress:"The {{ field }} field must be a valid IP address",uuid:"The {{ field }} field must be a valid UUID",ulid:"The {{ field }} field must be a valid ULID",hexCode:"The {{ field }} field must be a valid hex color code",boolean:"The value must be a boolean",number:"The {{ field }} field must be a number","number.in":"The selected {{ field }} is not in {{ values }}",min:"The {{ field }} field must be at least {{ min }}",max:"The {{ field }} field must not be greater than {{ max }}",range:"The {{ field }} field must be between {{ min }} and {{ max }}",positive:"The {{ field }} field must be positive",negative:"The {{ field }} field must be negative",decimal:"The {{ field }} field must have {{ digits }} decimal places",withoutDecimals:"The {{ field }} field must be an integer",accepted:"The {{ field }} field must be accepted",enum:"The selected {{ field }} is invalid",literal:"The {{ field }} field must be {{ expectedValue }}",object:"The {{ field }} field must be an object",array:"The {{ field }} field must be an array","array.minLength":"The {{ field }} field must have at least {{ min }} items","array.maxLength":"The {{ field }} field must not have more than {{ max }} items","array.fixedLength":"The {{ field }} field must contain {{ size }} items",notEmpty:"The {{ field }} field must not be empty",distinct:"The {{ field }} field has duplicate values",record:"The {{ field }} field must be an object","record.minLength":"The {{ field }} field must have at least {{ min }} items","record.maxLength":"The {{ field }} field must not have more than {{ max }} items","record.fixedLength":"The {{ field }} field must contain {{ size }} items",tuple:"The {{ field }} field must be an array",union:"Invalid value provided for {{ field }} field",unionGroup:"Invalid value provided for {{ field }} field",unionOfTypes:"Invalid value provided for {{ field }} field",date:"The {{ field }} field must be a datetime value","date.equals":"The {{ field }} field must be a date equal to {{ expectedValue }}","date.after":"The {{ field }} field must be a date after {{ expectedValue }}","date.before":"The {{ field }} field must be a date before {{ expectedValue }}","date.afterOrEqual":"The {{ field }} field must be a date after or equal to {{ expectedValue }}","date.beforeOrEqual":"The {{ field }} field must be a date before or equal to {{ expectedValue }}","date.sameAs":"The {{ field }} field and {{ otherField }} field must be the same","date.notSameAs":"The {{ field }} field and {{ otherField }} field must be different","date.afterField":"The {{ field }} field must be a date after {{ otherField }}","date.afterOrSameAs":"The {{ field }} field must be a date after or same as {{ otherField }}","date.beforeField":"The {{ field }} field must be a date before {{ otherField }}","date.beforeOrSameAs":"The {{ field }} field must be a date before or same as {{ otherField }}","date.weekend":"The {{ field }} field is not a weekend","date.weekday":"The {{ field }} field is not a weekday"},GM={"":"data"};var o0=class{static macro(g,$){this.prototype[g]=$}static getter(g,$,y=!1){Object.defineProperty(this.prototype,g,{get(){let M=$.call(this);if(y)Object.defineProperty(this,g,{configurable:!1,enumerable:!1,value:M,writable:!1});return M},configurable:!0,enumerable:!1})}};var B6=/[\p{Lu}]/u,C6=/[\p{Ll}]/u,WM=/^[\p{Lu}](?![\p{Lu}])/gu,wM=/([\p{Alpha}\p{N}_]|$)/u,K1=/[_.\- ]+/,T6=new RegExp("^"+K1.source),xM=new RegExp(K1.source+wM.source,"gu"),QM=new RegExp("\\d+"+wM.source,"gu"),k6=(g,$,y,M)=>{let q=!1,J=!1,Y=!1,Z=!1;for(let z=0;z<g.length;z++){let w=g[z];if(Z=z>2?g[z-3]==="-":!0,q&&B6.test(w))g=g.slice(0,z)+"-"+g.slice(z),q=!1,Y=J,J=!0,z++;else if(J&&Y&&C6.test(w)&&(!Z||M))g=g.slice(0,z-1)+"-"+g.slice(z-1),Y=J,J=!1,q=!0;else q=$(w)===w&&y(w)!==w,Y=J,J=y(w)===w&&$(w)!==w}return g},A6=(g,$)=>{return WM.lastIndex=0,g.replaceAll(WM,(y)=>$(y))},V6=(g,$)=>{return xM.lastIndex=0,QM.lastIndex=0,g.replaceAll(QM,(y,M,q)=>["_","-"].includes(g.charAt(q+y.length))?y:$(y)).replaceAll(xM,(y,M)=>$(M))};function s(g,$){if(!(typeof g==="string"||Array.isArray(g)))throw new TypeError("Expected the input to be `string | string[]`");if($={pascalCase:!1,preserveConsecutiveUppercase:!1,...$},Array.isArray(g))g=g.map((J)=>J.trim()).filter((J)=>J.length).join("-");else g=g.trim();if(g.length===0)return"";let y=$.locale===!1?(J)=>J.toLowerCase():(J)=>J.toLocaleLowerCase($.locale),M=$.locale===!1?(J)=>J.toUpperCase():(J)=>J.toLocaleUpperCase($.locale);if(g.length===1){if(K1.test(g))return"";return $.pascalCase?M(g):y(g)}if(g!==y(g))g=k6(g,y,M,$.preserveConsecutiveUppercase);if(g=g.replace(T6,""),g=$.preserveConsecutiveUppercase?A6(g,y):y(g),$.pascalCase)g=M(g.charAt(0))+g.slice(1);return V6(g,M)}var s2=u(O1(),1),b=u(O1(),1),e2=u(_M(),1),gq=u(UM(),1),$q=u(LM(),1);var _1=(g,$)=>$.some((y)=>y instanceof RegExp?y.test(g):y===g),m6=new Set(["https:","http:","file:"]),I6=(g)=>{try{let{protocol:$}=new URL(g);return $.endsWith(":")&&!$.includes(".")&&!m6.has($)}catch{return!1}},j6=(g,{stripHash:$})=>{let y=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(g);if(!y)throw new Error(`Invalid URL: ${g}`);let{type:M,data:q,hash:J}=y.groups,Y=M.split(";");J=$?"":J;let Z=!1;if(Y[Y.length-1]==="base64")Y.pop(),Z=!0;let z=Y.shift()?.toLowerCase()??"",K=[...Y.map((L)=>{let[C,G=""]=L.split("=").map((H)=>H.trim());if(C==="charset"){if(G=G.toLowerCase(),G==="us-ascii")return""}return`${C}${G?`=${G}`:""}`}).filter(Boolean)];if(Z)K.push("base64");if(K.length>0||z&&z!=="text/plain")K.unshift(z);return`data:${K.join(";")},${Z?q.trim():q}${J?`#${J}`:""}`};function U1(g,$){if($={defaultProtocol:"http",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,...$},typeof $.defaultProtocol==="string"&&!$.defaultProtocol.endsWith(":"))$.defaultProtocol=`${$.defaultProtocol}:`;if(g=g.trim(),/^data:/i.test(g))return j6(g,$);if(I6(g))return g;let y=g.startsWith("//");if(!(!y&&/^\.*\//.test(g)))g=g.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,$.defaultProtocol);let q=new URL(g);if($.forceHttp&&$.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if($.forceHttp&&q.protocol==="https:")q.protocol="http:";if($.forceHttps&&q.protocol==="http:")q.protocol="https:";if($.stripAuthentication)q.username="",q.password="";if($.stripHash)q.hash="";else if($.stripTextFragment)q.hash=q.hash.replace(/#?:~:text.*?$/i,"");if(q.pathname){let Y=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,Z=0,z="";for(;;){let K=Y.exec(q.pathname);if(!K)break;let L=K[0],C=K.index,G=q.pathname.slice(Z,C);z+=G.replace(/\/{2,}/g,"/"),z+=L,Z=C+L.length}let w=q.pathname.slice(Z,q.pathname.length);z+=w.replace(/\/{2,}/g,"/"),q.pathname=z}if(q.pathname)try{q.pathname=decodeURI(q.pathname)}catch{}if($.removeDirectoryIndex===!0)$.removeDirectoryIndex=[/^index\.[a-z]+$/];if(Array.isArray($.removeDirectoryIndex)&&$.removeDirectoryIndex.length>0){let Y=q.pathname.split("/"),Z=Y[Y.length-1];if(_1(Z,$.removeDirectoryIndex))Y=Y.slice(0,-1),q.pathname=Y.slice(1).join("/")+"/"}if(q.hostname){if(q.hostname=q.hostname.replace(/\.$/,""),$.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(q.hostname))q.hostname=q.hostname.replace(/^www\./,"")}if(Array.isArray($.removeQueryParameters)){for(let Y of[...q.searchParams.keys()])if(_1(Y,$.removeQueryParameters))q.searchParams.delete(Y)}if(!Array.isArray($.keepQueryParameters)&&$.removeQueryParameters===!0)q.search="";if(Array.isArray($.keepQueryParameters)&&$.keepQueryParameters.length>0){for(let Y of[...q.searchParams.keys()])if(!_1(Y,$.keepQueryParameters))q.searchParams.delete(Y)}if($.sortQueryParameters){q.searchParams.sort();try{q.search=decodeURIComponent(q.search)}catch{}}if($.removeTrailingSlash)q.pathname=q.pathname.replace(/\/$/,"");if($.removeExplicitPort&&q.port)q.port="";let J=g;if(g=q.toString(),!$.removeSingleSlash&&q.pathname==="/"&&!J.endsWith("/")&&q.hash==="")g=g.replace(/\/$/,"");if(($.removeTrailingSlash||q.pathname==="/")&&q.hash===""&&$.removeSingleSlash)g=g.replace(/\/$/,"");if(y&&!$.normalizeProtocol)g=g.replace(/^http:\/\//,"//");if($.stripProtocol)g=g.replace(/^(?:https?:)?\/\//,"");return g}var zq=u(PM(),1),Kq=u(BM(),1);var t6=class g{#g="";newLine=`
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
mutate: defineValue,
|
|
22
|
-
report: report,
|
|
23
|
-
isValid: true,
|
|
24
|
-
parent: ${Z},
|
|
25
|
-
isArrayMember: ${M},
|
|
26
|
-
});`}var s0=class{#g;#$;field;constructor(g,$,y,M){if(this.#$=M,this.#g=g,this.#$)this.field=this.#$;else $.variablesCounter++,this.field=$.createFieldFor(g,y)}defineField(g){if(!this.#$)g.writeStatement(i6({fieldNameExpression:this.field.fieldNameExpression,isArrayMember:this.field.isArrayMember,parentExpression:this.field.parentExpression,parentValueExpression:this.field.parentValueExpression,valueExpression:this.field.valueExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath,parseFnRefId:"parseFnId"in this.#g?this.#g.parseFnId:void 0}))}};function CM({variableName:g,guardedCodeSnippet:$}){return`if (${g}_is_array) {
|
|
27
|
-
${$}
|
|
28
|
-
}`}function Z$({variableName:g,bail:$,guardedCodeSnippet:y}){if(!$)return y;return`if (${g}.isValid) {
|
|
29
|
-
${y}
|
|
30
|
-
}`}function Wg({allowNull:g,conditional:$,variableName:y,outputExpression:M,transformFnRefId:q}){if(!g)return"";return`${$||"if"}(${y}.value === null) {
|
|
31
|
-
${M} = ${q?`refs['${q}'](null, ${y});`:"null;"}
|
|
32
|
-
}`}function a6(g,$){let[y,M]=g;if(y&&M)return`if (${y} && ${M}) {
|
|
33
|
-
${$}
|
|
34
|
-
}`;if(y)return`if (${y}) {
|
|
35
|
-
${$}
|
|
36
|
-
}`;if(M)return`if (${M}) {
|
|
37
|
-
${$}
|
|
38
|
-
}`;return $}function p6({isAsync:g,implicit:$,ruleFnId:y},M,q,J,Y){let Z=`refs['${y}']`,z=`${Z}.validator(${M}.value, ${Z}.options, ${M});`;Y=Y||`${M}.isDefined`;let w=q?`${M}.isValid`:"";return a6([w,$||J?"":Y],g?`await ${z}`:`${z}`)}function xg({bail:g,validations:$,variableName:y,dropMissingCheck:M,existenceCheckExpression:q}){return`${$.map((J)=>p6(J,y,g,M,q)).join(`
|
|
39
|
-
`)}`}function TM({variableName:g,outputExpression:$,outputValueExpression:y}){return`const ${g}_out = ${y};
|
|
40
|
-
${$} = ${g}_out;`}function Qg({allowNull:g,isOptional:$,variableName:y}){if($===!1)if(g===!1)return`ensureExists(${y});`;else return`ensureIsDefined(${y});`;return""}function kM({variableName:g}){return`const ${g}_is_array = ensureIsArray(${g});`}var l6=class extends s0{#g;#$;#y;constructor(g,$,y,M,q){super(g,y,M,q);this.#g=g,this.#$=$,this.#y=y}#M(){let g=this.#$.child(),$={type:"tuple",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath};return this.#g.properties.forEach((y)=>{this.#y.compileNode(y,g,$)}),g.toString()}compile(){this.defineField(this.#$),this.#$.writeStatement(Qg({allowNull:this.#g.allowNull,isOptional:this.#g.isOptional,variableName:this.field.variableName})),this.#$.writeStatement(kM({variableName:this.field.variableName})),this.#$.writeStatement(xg({variableName:this.field.variableName,validations:this.#g.validations,bail:this.#g.bail,dropMissingCheck:!1,existenceCheckExpression:`${this.field.variableName}_is_array`}));let g=CM({variableName:this.field.variableName,guardedCodeSnippet:`${this.#$.newLine}${Z$({variableName:this.field.variableName,bail:this.#g.bail,guardedCodeSnippet:`${TM({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:this.#g.allowUnknownProperties?`copyProperties(${this.field.variableName}.value)`:"[]"})}${this.#$.newLine}${this.#M()}`})}`});this.#$.writeStatement(`${g}${this.#$.newLine}${Wg({allowNull:this.#g.allowNull,outputExpression:this.field.outputExpression,variableName:this.field.variableName,conditional:"else if"})}`)}};function o6({variableName:g,loopCodeSnippet:$,startingIndex:y}){return y=y||0,`const ${g}_items_size = ${g}.value.length;
|
|
41
|
-
for (let ${g}_i = ${y}; ${g}_i < ${g}_items_size; ${g}_i++) {
|
|
42
|
-
${$}
|
|
43
|
-
}`}var s6=class extends s0{#g;#$;#y;constructor(g,$,y,M,q){super(g,y,M,q);this.#g=g,this.#$=$,this.#y=y}#M(){let g=this.#$.child();this.#y.compileNode(this.#g.each,g,{type:"array",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath});let $=this.#$.child();return $.writeStatement(o6({variableName:this.field.variableName,startingIndex:0,loopCodeSnippet:g.toString()})),g.flush(),$.toString()}compile(){this.defineField(this.#$),this.#$.writeStatement(Qg({allowNull:this.#g.allowNull,isOptional:this.#g.isOptional,variableName:this.field.variableName})),this.#$.writeStatement(kM({variableName:this.field.variableName})),this.#$.writeStatement(xg({variableName:this.field.variableName,validations:this.#g.validations,bail:this.#g.bail,dropMissingCheck:!1,existenceCheckExpression:`${this.field.variableName}_is_array`}));let g=CM({variableName:this.field.variableName,guardedCodeSnippet:`${this.#$.newLine}${Z$({variableName:this.field.variableName,bail:this.#g.bail,guardedCodeSnippet:`${TM({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:"[]"})}${this.#$.newLine}${this.#M()}`})}`});this.#$.writeStatement(`${g}${this.#$.newLine}${Wg({allowNull:this.#g.allowNull,outputExpression:this.field.outputExpression,variableName:this.field.variableName,conditional:"else if"})}`)}};function e6({parseFnRefId:g,variableName:$}){if(g)return`${$}.value = refs['${g}'](${$}.value);`;return""}function AM({variableName:g,conditionalFnRefId:$}){return`else {
|
|
44
|
-
refs['${$}'](${g}.value, ${g});
|
|
45
|
-
}`}function VM({conditional:g,variableName:$,conditionalFnRefId:y,guardedCodeSnippet:M}){return`${g}(refs['${y}'](${$}.value, ${$})) {
|
|
46
|
-
${M}
|
|
47
|
-
}`}var gz=class extends s0{#g;#$;#y;#M;constructor(g,$,y,M,q){super(g,y,M,q);this.#$=g,this.#y=$,this.#M=M,this.#g=y}#q(){let g=this.#y.child();if(this.#$.conditions.forEach(($,y)=>{let M=this.#y.child();if("parseFnId"in $.schema)M.writeStatement(e6({parseFnRefId:$.schema.parseFnId,variableName:this.field.variableName}));this.#g.compileNode($.schema,M,this.#M,this.field),g.writeStatement(VM({conditional:y===0?"if":"else if",variableName:this.field.variableName,conditionalFnRefId:$.conditionalFnRefId,guardedCodeSnippet:M.toString()})),M.flush()}),this.#$.elseConditionalFnRefId&&this.#$.conditions.length)g.writeStatement(AM({variableName:this.field.variableName,conditionalFnRefId:this.#$.elseConditionalFnRefId}));return g.toString()}compile(){this.defineField(this.#y),this.#y.writeStatement(this.#q())}};function $z({variableName:g,loopCodeSnippet:$}){return`const ${g}_keys = Object.keys(${g}.value);
|
|
48
|
-
const ${g}_keys_size = ${g}_keys.length;
|
|
49
|
-
for (let ${g}_key_i = 0; ${g}_key_i < ${g}_keys_size; ${g}_key_i++) {
|
|
50
|
-
const ${g}_i = ${g}_keys[${g}_key_i];
|
|
51
|
-
${$}
|
|
52
|
-
}`}function mM({variableName:g,guardedCodeSnippet:$}){return`if (${g}_is_object) {
|
|
53
|
-
${$}
|
|
54
|
-
}`}function IM({variableName:g,outputExpression:$,outputValueExpression:y}){return`const ${g}_out = ${y};
|
|
55
|
-
${$} = ${g}_out;`}function jM({variableName:g}){return`const ${g}_is_object = ensureIsObject(${g});`}var yz=class extends s0{#g;#$;#y;constructor(g,$,y,M,q){super(g,y,M,q);this.#g=g,this.#$=$,this.#y=y}#M(){let g=this.#$.child(),$=this.#$.child();return this.#y.compileNode(this.#g.each,$,{type:"record",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath}),g.writeStatement($z({variableName:this.field.variableName,loopCodeSnippet:$.toString()})),$.flush(),g.toString()}compile(){this.defineField(this.#$),this.#$.writeStatement(Qg({allowNull:this.#g.allowNull,isOptional:this.#g.isOptional,variableName:this.field.variableName})),this.#$.writeStatement(jM({variableName:this.field.variableName})),this.#$.writeStatement(xg({variableName:this.field.variableName,validations:this.#g.validations,bail:this.#g.bail,dropMissingCheck:!1,existenceCheckExpression:`${this.field.variableName}_is_object`}));let g=Z$({variableName:this.field.variableName,bail:this.#g.bail,guardedCodeSnippet:`${IM({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:"{}"})}${this.#M()}`}),$=mM({variableName:this.field.variableName,guardedCodeSnippet:`${this.#$.newLine}${g}`});this.#$.writeStatement(`${$}${this.#$.newLine}${Wg({allowNull:this.#g.allowNull,outputExpression:this.field.outputExpression,variableName:this.field.variableName,conditional:"else if"})}`)}};function Mz(g){return`[${g.map(($)=>`"${$}"`).join(", ")}]`}function qz({variableName:g,fieldsToIgnore:$,allowUnknownProperties:y}){if(!y)return"";let M=Mz($);return`moveProperties(${g}.value, ${g}_out, ${M});`}var Jz=class extends s0{#g;#$;#y;constructor(g,$,y,M,q){super(g,y,M,q);this.#g=g,this.#$=$,this.#y=y}#M(g){let $=g.properties.map((M)=>M.fieldName),y=g.groups.flatMap((M)=>this.#q(M));return $.concat(y)}#q(g){return g.conditions.flatMap(($)=>{return this.#M($.schema)})}#J(){let g=this.#$.child(),$={type:"object",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath};return this.#g.properties.forEach((y)=>this.#y.compileNode(y,g,$)),g.toString()}#Y(){let g=this.#$.child(),$={type:"object",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath};return this.#g.groups.forEach((y)=>this.#Z(y,g,$)),g.toString()}#Z(g,$,y){if(g.conditions.forEach((M,q)=>{let J=$.child();M.schema.properties.forEach((Y)=>{this.#y.compileNode(Y,J,y)}),M.schema.groups.forEach((Y)=>{this.#Z(Y,J,y)}),$.writeStatement(VM({variableName:this.field.variableName,conditional:q===0?"if":"else if",conditionalFnRefId:M.conditionalFnRefId,guardedCodeSnippet:J.toString()}))}),g.elseConditionalFnRefId&&g.conditions.length)$.writeStatement(AM({variableName:this.field.variableName,conditionalFnRefId:g.elseConditionalFnRefId}))}compile(){this.defineField(this.#$),this.#$.writeStatement(Qg({allowNull:this.#g.allowNull,isOptional:this.#g.isOptional,variableName:this.field.variableName})),this.#$.writeStatement(jM({variableName:this.field.variableName})),this.#$.writeStatement(xg({variableName:this.field.variableName,validations:this.#g.validations,bail:this.#g.bail,dropMissingCheck:!1,existenceCheckExpression:`${this.field.variableName}_is_object`}));let g=Z$({variableName:this.field.variableName,bail:this.#g.bail,guardedCodeSnippet:`${IM({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:"{}"})}${this.#$.newLine}${this.#J()}${this.#$.newLine}${this.#Y()}${this.#$.newLine}${qz({variableName:this.field.variableName,allowUnknownProperties:this.#g.allowUnknownProperties,fieldsToIgnore:this.#g.allowUnknownProperties?this.#M(this.#g):[]})}`}),$=mM({variableName:this.field.variableName,guardedCodeSnippet:`${g}`});this.#$.writeStatement(`${$}${this.#$.newLine}${Wg({variableName:this.field.variableName,allowNull:this.#g.allowNull,outputExpression:this.field.outputExpression,conditional:"else if"})}`)}};function Yz(g){return{parentExpression:g.variableName,parentValueExpression:g.variableName,fieldNameExpression:"''",fieldPathExpression:"''",wildCardPath:"",variableName:`${g.variableName}_item`,valueExpression:"root",outputExpression:g.outputExpression,isArrayMember:!1}}function Zz({variableName:g,outputExpression:$,transformFnRefId:y}){let M=y?`refs['${y}'](${g}.value, ${g})`:`${g}.value`;return`if (${g}.isDefined && ${g}.isValid) {
|
|
56
|
-
${$} = ${M};
|
|
57
|
-
}`}var zz=class extends s0{#g;#$;constructor(g,$,y,M,q){super(g,y,M,q);this.#g=g,this.#$=$}compile(){this.defineField(this.#$),this.#$.writeStatement(Qg({allowNull:this.#g.allowNull,isOptional:this.#g.isOptional,variableName:this.field.variableName})),this.#$.writeStatement(xg({variableName:this.field.variableName,validations:this.#g.validations,bail:this.#g.bail,dropMissingCheck:!1})),this.#$.writeStatement(`${Zz({variableName:this.field.variableName,outputExpression:this.field.outputExpression,transformFnRefId:this.#g.transformFnId})}${this.#$.newLine}${Wg({variableName:this.field.variableName,allowNull:this.#g.allowNull,outputExpression:this.field.outputExpression,transformFnRefId:this.#g.transformFnId,conditional:"else if"})}`)}};function Kz(g){let $=g.wildCardPath!==""?`${g.wildCardPath}.*`:"*";return{parentExpression:g.variableName,parentValueExpression:`${g.variableName}.value`,fieldNameExpression:`${g.variableName}_i`,fieldPathExpression:$,wildCardPath:$,variableName:`${g.variableName}_item`,valueExpression:`${g.variableName}.value[${g.variableName}_i]`,outputExpression:`${g.variableName}_out[${g.variableName}_i]`,isArrayMember:!0}}function Hz(g,$){let y=$.wildCardPath!==""?`${$.wildCardPath}.${g.fieldName}`:g.fieldName;return{parentExpression:$.variableName,parentValueExpression:`${$.variableName}.value`,fieldNameExpression:`${g.fieldName}`,fieldPathExpression:y,wildCardPath:y,variableName:`${$.variableName}_item_${g.fieldName}`,valueExpression:`${$.variableName}.value[${g.fieldName}]`,outputExpression:`${$.variableName}_out[${g.propertyName}]`,isArrayMember:!0}}function Dz(){return`if(errorReporter.hasErrors) {
|
|
58
|
-
throw errorReporter.createError();
|
|
59
|
-
}`}var Oz=/\d/,Xz=/[A-Za-z0-9]+/;function Gz(g=""){if(Oz.test(g))return;return g!==g.toLowerCase()}function Wz(g){return g?g[0].toUpperCase()+g.slice(1):""}function xz(g){return g?g[0].toLowerCase()+g.slice(1):""}function Qz(g){let $=[];if(!g||typeof g!=="string")return $;let y="",M,q;for(let J of g){let Y=!Xz.test(J);if(Y===!0){$.push(y),y="",M=void 0;continue}let Z=Gz(J);if(q===!1){if(M===!1&&Z===!0){$.push(y),y=J,M=Z;continue}if(M===!0&&Z===!1&&y.length>1){let z=y.at(-1);$.push(y.slice(0,Math.max(0,y.length-1))),y=z+J,M=Z;continue}}y+=J,M=Z,q=Y}return $.push(y),$}function wz(g){let $=Qz(g).map((y)=>Wz(y.toLowerCase())).join("");return/^[0-9]+/.test($)?`var_${$}`:xz($)}function _z(g,$,y){let M=y.wildCardPath!==""?`${y.wildCardPath}.${g.fieldName}`:g.fieldName;return{parentExpression:y.variableName,parentValueExpression:`${y.variableName}.value`,fieldNameExpression:`'${g.fieldName}'`,fieldPathExpression:M,wildCardPath:M,variableName:`${wz(g.propertyName)}_${$}`,valueExpression:`${y.variableName}.value['${g.fieldName}']`,outputExpression:`${y.variableName}_out['${g.propertyName}']`,isArrayMember:!1}}function Uz(g){let $=g.wildCardPath!==""?`${g.wildCardPath}.*`:"*";return{parentExpression:g.variableName,parentValueExpression:`${g.variableName}.value`,fieldNameExpression:`${g.variableName}_i`,fieldPathExpression:$,wildCardPath:$,variableName:`${g.variableName}_item`,valueExpression:`${g.variableName}.value[${g.variableName}_i]`,outputExpression:`${g.variableName}_out[${g.variableName}_i]`,isArrayMember:!1}}function Lz(g){return`function report(message, rule, field, args) {
|
|
60
|
-
field.isValid = false;
|
|
61
|
-
errorReporter.report(messagesProvider.getMessage(message, rule, field, args), rule, field, args);
|
|
62
|
-
};
|
|
63
|
-
function defineValue(value, field) {
|
|
64
|
-
${g.convertEmptyStringsToNull?"if (value === '') { value = null; }":""}
|
|
65
|
-
field.value = value;
|
|
66
|
-
field.isDefined = value !== undefined && value !== null;
|
|
67
|
-
return field;
|
|
68
|
-
};
|
|
69
|
-
function ensureExists(field) {
|
|
70
|
-
if (field.value === undefined || field.value === null) {
|
|
71
|
-
field.report(REQUIRED, 'required', field);
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
return true;
|
|
75
|
-
};
|
|
76
|
-
function ensureIsDefined(field) {
|
|
77
|
-
if (field.value === undefined) {
|
|
78
|
-
field.report(REQUIRED, 'required', field);
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
return true;
|
|
82
|
-
};
|
|
83
|
-
function ensureIsObject(field) {
|
|
84
|
-
if (!field.isDefined) {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
if (typeof field.value == 'object' && !Array.isArray(field.value)) {
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
field.report(NOT_AN_OBJECT, 'object', field);
|
|
91
|
-
return false;
|
|
92
|
-
};
|
|
93
|
-
function ensureIsArray(field) {
|
|
94
|
-
if (!field.isDefined) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
if (Array.isArray(field.value)) {
|
|
98
|
-
return true;
|
|
99
|
-
}
|
|
100
|
-
field.report(NOT_AN_ARRAY, 'array', field);
|
|
101
|
-
return false;
|
|
102
|
-
};
|
|
103
|
-
function copyProperties(val) {
|
|
104
|
-
let k, out, tmp;
|
|
319
|
+
${l.length>0?`
|
|
320
|
+
<div class="card">
|
|
321
|
+
<div class="card-header">\uD83D\uDCDA Stack Trace</div>
|
|
322
|
+
${l.map((v)=>`
|
|
323
|
+
<div class="stack-frame" onclick="this.classList.toggle('expanded')">
|
|
324
|
+
<div class="frame-function">${c(v.function||"<anonymous>")}</div>
|
|
325
|
+
<div class="frame-file">
|
|
326
|
+
${c(v.file)}:<span class="frame-line">${v.line}</span>${v.column?`:${v.column}`:""}
|
|
327
|
+
</div>
|
|
328
|
+
</div>
|
|
329
|
+
`).join("")}
|
|
330
|
+
</div>
|
|
331
|
+
`:""}
|
|
105
332
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
333
|
+
${this.config.showRequest&&this.request?`
|
|
334
|
+
<div class="card">
|
|
335
|
+
<div class="card-header">\uD83C\uDF10 Request</div>
|
|
336
|
+
<div class="card-body">
|
|
337
|
+
<table class="info-table">
|
|
338
|
+
<tr>
|
|
339
|
+
<td>Method</td>
|
|
340
|
+
<td><span class="badge badge-method">${c(this.request.method)}</span></td>
|
|
341
|
+
</tr>
|
|
342
|
+
<tr>
|
|
343
|
+
<td>URL</td>
|
|
344
|
+
<td>${c(this.request.url)}</td>
|
|
345
|
+
</tr>
|
|
346
|
+
${this.request.queryParams&&Object.keys(this.request.queryParams).length>0?`
|
|
347
|
+
<tr>
|
|
348
|
+
<td>Query Params</td>
|
|
349
|
+
<td><code>${c(JSON.stringify(this.request.queryParams,null,2))}</code></td>
|
|
350
|
+
</tr>
|
|
351
|
+
`:""}
|
|
352
|
+
${this.request.body?`
|
|
353
|
+
<tr>
|
|
354
|
+
<td>Body</td>
|
|
355
|
+
<td><code>${c(JSON.stringify(this.request.body,null,2))}</code></td>
|
|
356
|
+
</tr>
|
|
357
|
+
`:""}
|
|
358
|
+
</table>
|
|
359
|
+
</div>
|
|
360
|
+
</div>
|
|
361
|
+
`:""}
|
|
362
|
+
|
|
363
|
+
${this.routing?`
|
|
364
|
+
<div class="card">
|
|
365
|
+
<div class="card-header">\uD83D\uDEE4️ Routing</div>
|
|
366
|
+
<div class="card-body">
|
|
367
|
+
<table class="info-table">
|
|
368
|
+
${this.routing.controller?`<tr><td>Controller</td><td>${c(this.routing.controller)}</td></tr>`:""}
|
|
369
|
+
${this.routing.routeName?`<tr><td>Route Name</td><td>${c(this.routing.routeName)}</td></tr>`:""}
|
|
370
|
+
${this.routing.middleware?.length?`<tr><td>Middleware</td><td>${this.routing.middleware.map((v)=>c(v)).join(", ")}</td></tr>`:""}
|
|
371
|
+
</table>
|
|
372
|
+
</div>
|
|
373
|
+
</div>
|
|
374
|
+
`:""}
|
|
375
|
+
|
|
376
|
+
${this.user?`
|
|
377
|
+
<div class="card">
|
|
378
|
+
<div class="card-header">\uD83D\uDC64 User</div>
|
|
379
|
+
<div class="card-body">
|
|
380
|
+
<table class="info-table">
|
|
381
|
+
${this.user.id?`<tr><td>ID</td><td>${c(String(this.user.id))}</td></tr>`:""}
|
|
382
|
+
${this.user.email?`<tr><td>Email</td><td>${c(this.user.email)}</td></tr>`:""}
|
|
383
|
+
${this.user.name?`<tr><td>Name</td><td>${c(this.user.name)}</td></tr>`:""}
|
|
384
|
+
</table>
|
|
385
|
+
</div>
|
|
386
|
+
</div>
|
|
387
|
+
`:""}
|
|
388
|
+
|
|
389
|
+
${this.config.showQueries&&this.queries.length>0?`
|
|
390
|
+
<div class="card">
|
|
391
|
+
<div class="card-header">\uD83D\uDDC4️ Queries (${this.queries.length})</div>
|
|
392
|
+
<div class="card-body">
|
|
393
|
+
${this.queries.map((v)=>`
|
|
394
|
+
<div class="query-item">
|
|
395
|
+
${c(v.query)}
|
|
396
|
+
${v.time!==void 0?`<div class="query-time">${v.time.toFixed(2)}ms${v.connection?` • ${c(v.connection)}`:""}</div>`:""}
|
|
397
|
+
</div>
|
|
398
|
+
`).join("")}
|
|
399
|
+
</div>
|
|
400
|
+
</div>
|
|
401
|
+
`:""}
|
|
111
402
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
};`}function Pz(g){return`const REQUIRED = '${g.required}';
|
|
129
|
-
const NOT_AN_OBJECT = '${g.object}';
|
|
130
|
-
const NOT_AN_ARRAY = '${g.array}';`}var Bz=Object.getPrototypeOf(async function(){}).constructor,B1=class{variablesCounter=0;#g;#$;#y=new t6;constructor(g,$){this.#g=g,this.#$=$||{convertEmptyStringsToNull:!1}}#M(){this.#y.writeStatement(Pz({required:"value is required",object:"value is not a valid object",array:"value is not a valid array",...this.#$.messages})),this.#y.writeStatement(Lz(this.#$)),this.#y.writeStatement("let out;")}#q(){this.#y.writeStatement(Dz()),this.#y.writeStatement("return out;")}#J(){this.compileNode(this.#g.schema,this.#y,{type:"root",variableName:"root",outputExpression:"out",fieldPathExpression:"out",wildCardPath:""})}#Y(){return new Bz("root","meta","refs","messagesProvider","errorReporter",this.#y.toString())}createFieldFor(g,$){switch($.type){case"array":return Kz($);case"root":return Yz($);case"object":return _z(g,this.variablesCounter,$);case"tuple":return Hz(g,$);case"record":return Uz($)}}compileNode(g,$,y,M){switch(g.type){case"literal":return new zz(g,$,this,y,M).compile();case"array":return new s6(g,$,this,y,M).compile();case"record":return new yz(g,$,this,y,M).compile();case"object":return new Jz(g,$,this,y,M).compile();case"tuple":return new l6(g,$,this,y,M).compile();case"union":return new gz(g,$,this,y,M).compile()}}compile(){this.#M(),this.#J(),this.#q();let g=this.#Y();return this.variablesCounter=0,this.#y.flush(),g}};function EM(){let g=0,$={};return{toJSON(){return $},track(y){g++;let M=`ref://${g}`;return $[M]=y,M},trackValidation(y){return this.track(y)},trackParser(y){return this.track(y)},trackTransformer(y){return this.track(y)},trackConditional(y){return this.track(y)}}}function U(g,$){let y={validator:g,isAsync:$?.isAsync||g.constructor.name==="AsyncFunction",implicit:$?.implicit??!1};return function(...M){return{rule:y,options:M[0]}}}var l2={};hg(l2,{COTYPE:()=>kz,IS_OF_TYPE:()=>U0,ITYPE:()=>Cz,OTYPE:()=>Tz,PARSE:()=>F,SUBTYPE:()=>L0,UNIQUE_NAME:()=>X0,VALIDATION:()=>I0});var X0=Symbol.for("schema_name"),U0=Symbol.for("is_of_type"),F=Symbol.for("parse"),Cz=Symbol.for("opaque_input_type"),Tz=Symbol.for("opaque_type"),kz=Symbol.for("camelcase_opaque_type"),I0=Symbol.for("to_validation"),L0=Symbol.for("subtype"),_0=U((g,$,y)=>{let M=$(y);if(!y.isDefined&&M)y.report(Q.required,"required",y)},{implicit:!0}),K$=class extends o0{optional(g){return new Vz(this,g)}nullable(){return new Az(this)}transform(g){return new mz(g,this)}},Az=class g extends K${#g;constructor($){super();this.#g=$}clone(){return new g(this.#g.clone())}[F]($,y,M){let q=this.#g[F]($,y,M);return q.allowNull=!0,q}},Vz=class g extends K${#g;validations;constructor($,y){super();this.#g=$,this.validations=y||[]}cloneValidations(){return this.validations.map(($)=>{return{options:$.options,rule:$.rule}})}compileValidations($){return this.validations.map((y)=>{return{ruleFnId:$.track({validator:y.rule.validator,options:y.options}),implicit:y.rule.implicit,isAsync:y.rule.isAsync}})}use($){return this.validations.push(I0 in $?$[I0]():$),this}requiredWhen($,y,M){if(typeof $==="function")return this.use(_0($));let q;switch(y){case"=":q=(J)=>J===M;break;case"!=":q=(J)=>J!==M;break;case"in":q=(J)=>M.includes(J);break;case"notIn":q=(J)=>!M.includes(J);break;case">":q=(J)=>J>M;break;case"<":q=(J)=>J<M;break;case">=":q=(J)=>J>=M;break;case"<=":q=(J)=>J<=M}return this.use(_0((J)=>{let Y=A.getNestedValue($,J);return q(Y)}))}requiredIfExists($){let y=Array.isArray($)?$:[$];return this.use(_0((M)=>{return y.every((q)=>A.exists(A.getNestedValue(q,M)))}))}requiredIfAnyExists($){return this.use(_0((y)=>{return $.some((M)=>A.exists(A.getNestedValue(M,y)))}))}requiredIfMissing($){let y=Array.isArray($)?$:[$];return this.use(_0((M)=>{return y.every((q)=>A.isMissing(A.getNestedValue(q,M)))}))}requiredIfAnyMissing($){return this.use(_0((y)=>{return $.some((M)=>A.isMissing(A.getNestedValue(M,y)))}))}clone(){return new g(this.#g.clone(),this.cloneValidations())}[F]($,y,M){let q=this.#g[F]($,y,M);return q.isOptional=!0,q.validations=q.validations.concat(this.compileValidations(y)),q}},mz=class g extends K${#g;#$;constructor($,y){super();this.#$=$,this.#g=y}clone(){return new g(this.#$,this.#g.clone())}[F]($,y,M){let q=this.#g[F]($,y,M);return q.transformFnId=y.trackTransformer(this.#$),q}},T0=class extends K${options;validations;constructor(g,$){super();this.options={bail:!0,allowNull:!1,isOptional:!1,...g},this.validations=$||[]}cloneValidations(){return this.validations.map((g)=>{return{options:g.options,rule:g.rule}})}cloneOptions(){return{...this.options}}compileValidations(g){return this.validations.map(($)=>{return{ruleFnId:g.track({validator:$.rule.validator,options:$.options}),implicit:$.rule.implicit,isAsync:$.rule.isAsync}})}parse(g){return this.options.parse=g,this}use(g){return this.validations.push(I0 in g?g[I0]():g),this}bail(g){return this.options.bail=g,this}[F](g,$,y){return{type:"literal",subtype:this[L0],fieldName:g,propertyName:y.toCamelCase?s(g):g,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,parseFnId:this.options.parse?$.trackParser(this.options.parse):void 0,validations:this.compileValidations($)}}},o2=class g extends T0{constructor($,y){super($,y)}[L0]="any";clone(){return new g(this.cloneOptions(),this.cloneValidations())}},z$=U((g,$,y)=>{let M=typeof $.choices==="function"?$.choices(y):$.choices;if(!M.includes(g))y.report(Q.enum,"enum",y,{choices:M})}),H$=class g extends T0{static rules={enum:z$};#g;[L0]="enum";getChoices(){return this.#g}constructor($,y,M){super(y,M||[z$({choices:$})]);this.#g=$}clone(){return new g(this.#g,this.cloneOptions(),this.cloneValidations())}},v0=["YYYY-MM-DD","YYYY-MM-DD HH:mm:ss"];b.default.extend($q.default);b.default.extend(e2.default);b.default.extend(gq.default);var Iz=U((g,$,y)=>{if(typeof g!=="string"&&typeof g!=="number"){y.report(Q.date,"date",y);return}let M=!1,q=!1,J=$.formats||v0;if(Array.isArray(J))J=[...J],M=J.includes("x"),q=J.includes("iso8601");else if(typeof J!=="string")J={...J},M=J.format==="x",q=J.format==="iso";let Y=M?A.asNumber(g):g,Z;if(M&&!Number.isNaN(Y))Z=b.default(Y);else Z=b.default(g,J,!0);if(!Z.isValid()&&q)Z=b.default(g);if(!Z.isValid()){y.report(Q.date,"date",y);return}y.meta.$value=Z,y.meta.$formats=J,y.mutate(Z.toDate(),y)}),FM=U((g,$,y)=>{if(!y.meta.$value)return;let M=$.compare||"day",q=$.format||v0,J=y.meta.$value,Y=typeof $.expectedValue==="function"?$.expectedValue(y):$.expectedValue,Z=b.default(Y,q,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${Y}" provided to the equals rule`);if(!J.isSame(Z,M))y.report(Q["date.equals"],"date.equals",y,{expectedValue:Y,compare:M})}),hM=U((g,$,y)=>{if(!y.meta.$value)return;let M=$.compare||"day",q=$.format||v0,J=y.meta.$value,Y=typeof $.expectedValue==="function"?$.expectedValue(y):$.expectedValue,Z=Y==="today"?b.default():Y==="tomorrow"?b.default().add(1,"day"):b.default(Y,q,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${Y}" provided to the after rule`);if(!J.isAfter(Z,M))y.report(Q["date.after"],"date.after",y,{expectedValue:Y,compare:M})}),SM=U((g,$,y)=>{if(!y.meta.$value)return;let M=$.compare||"day",q=$.format||v0,J=y.meta.$value,Y=typeof $.expectedValue==="function"?$.expectedValue(y):$.expectedValue,Z=Y==="today"?b.default():Y==="tomorrow"?b.default().add(1,"day"):b.default(Y,q,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${Y}" provided to the afterOrEqual rule`);if(!J.isSameOrAfter(Z,M))y.report(Q["date.afterOrEqual"],"date.afterOrEqual",y,{expectedValue:Y,compare:M})}),uM=U((g,$,y)=>{if(!y.meta.$value)return;let M=$.compare||"day",q=$.format||v0,J=y.meta.$value,Y=typeof $.expectedValue==="function"?$.expectedValue(y):$.expectedValue,Z=Y==="today"?b.default():Y==="yesterday"?b.default().subtract(1,"day"):b.default(Y,q,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${Y}" provided to the before rule`);if(!J.isBefore(Z,M))y.report(Q["date.before"],"date.before",y,{expectedValue:Y,compare:M})}),NM=U((g,$,y)=>{if(!y.meta.$value)return;let M=$.compare||"day",q=$.format||v0,J=y.meta.$value,Y=typeof $.expectedValue==="function"?$.expectedValue(y):$.expectedValue,Z=Y==="today"?b.default():Y==="yesterday"?b.default().subtract(1,"day"):b.default(Y,q,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${Y}" provided to the beforeOrEqual rule`);if(!J.isSameOrBefore(Z,M))y.report(Q["date.beforeOrEqual"],"date.beforeOrEqual",y,{expectedValue:Y,compare:M})}),RM=U((g,$,y)=>{if(!y.meta.$value)return;let M=$.compare||"day",q=y.meta.$value,J=$.format||y.meta.$formats,Y=A.getNestedValue($.otherField,y),Z=b.default(Y,J,!0);if(!Z.isValid())return;if(!q.isSame(Z,M))y.report(Q["date.sameAs"],"date.sameAs",y,{otherField:$.otherField,expectedValue:Y,compare:M})}),bM=U((g,$,y)=>{if(!y.meta.$value)return;let M=$.compare||"day",q=y.meta.$value,J=$.format||y.meta.$formats,Y=A.getNestedValue($.otherField,y),Z=b.default(Y,J,!0);if(!Z.isValid())return;if(q.isSame(Z,M))y.report(Q["date.notSameAs"],"date.notSameAs",y,{otherField:$.otherField,expectedValue:Y,compare:M})}),nM=U((g,$,y)=>{if(!y.meta.$value)return;let M=$.compare||"day",q=y.meta.$value,J=$.format||y.meta.$formats,Y=A.getNestedValue($.otherField,y),Z=b.default(Y,J,!0);if(!Z.isValid())return;if(!q.isAfter(Z,M))y.report(Q["date.afterField"],"date.afterField",y,{otherField:$.otherField,expectedValue:Y,compare:M})}),cM=U((g,$,y)=>{if(!y.meta.$value)return;let M=$.compare||"day",q=y.meta.$value,J=$.format||y.meta.$formats,Y=A.getNestedValue($.otherField,y),Z=b.default(Y,J,!0);if(!Z.isValid())return;if(!q.isSameOrAfter(Z,M))y.report(Q["date.afterOrSameAs"],"date.afterOrSameAs",y,{otherField:$.otherField,expectedValue:Y,compare:M})}),vM=U((g,$,y)=>{if(!y.meta.$value)return;let M=$.compare||"day",q=y.meta.$value,J=$.format||y.meta.$formats,Y=A.getNestedValue($.otherField,y),Z=b.default(Y,J,!0);if(!Z.isValid())return;if(!q.isBefore(Z,M))y.report(Q["date.beforeField"],"date.beforeField",y,{otherField:$.otherField,expectedValue:Y,compare:M})}),rM=U((g,$,y)=>{if(!y.meta.$value)return;let M=$.compare||"day",q=y.meta.$value,J=$.format||y.meta.$formats,Y=A.getNestedValue($.otherField,y),Z=b.default(Y,J,!0);if(!Z.isValid())return;if(!q.isSameOrBefore(Z,M))y.report(Q["date.beforeOrSameAs"],"date.beforeOrSameAs",y,{otherField:$.otherField,expectedValue:Y,compare:M})}),fM=U((g,$,y)=>{if(!y.meta.$value)return;let q=y.meta.$value.day();if(q!==0&&q!==6)y.report(Q["date.weekend"],"date.weekend",y)}),dM=U((g,$,y)=>{if(!y.meta.$value)return;let q=y.meta.$value.day();if(q===0||q===6)y.report(Q["date.weekday"],"date.weekday",y)}),T1=class g extends T0{static rules={equals:FM,after:hM,afterOrEqual:SM,before:uM,beforeOrEqual:NM,sameAs:RM,notSameAs:bM,afterField:nM,afterOrSameAs:cM,beforeField:vM,beforeOrSameAs:rM,weekend:fM,weekday:dM};[X0]="vine.date";[L0]="date";[U0]=($)=>{if(typeof $!=="string")return!1;return s2.default($,this.options.formats||v0,!0).isValid()};constructor($,y){super($,y||[Iz($||{})])}equals($,y){return this.use(FM({expectedValue:$,...y}))}after($,y){return this.use(hM({expectedValue:$,...y}))}afterOrEqual($,y){return this.use(SM({expectedValue:$,...y}))}before($,y){return this.use(uM({expectedValue:$,...y}))}beforeOrEqual($,y){return this.use(NM({expectedValue:$,...y}))}sameAs($,y){return this.use(RM({otherField:$,...y}))}notSameAs($,y){return this.use(bM({otherField:$,...y}))}afterField($,y){return this.use(nM({otherField:$,...y}))}afterOrSameAs($,y){return this.use(cM({otherField:$,...y}))}beforeField($,y){return this.use(vM({otherField:$,...y}))}beforeOrSameAs($,y){return this.use(rM({otherField:$,...y}))}weekend(){return this.use(fM())}weekday(){return this.use(dM())}clone(){return new g(this.cloneOptions(),this.cloneValidations())}},yq=class g{#g;#$=($,y)=>{y.report(Q.union,"union",y)};constructor($){this.#g=$}otherwise($){return this.#$=$,this}clone(){let $=new g(this.#g);return $.otherwise(this.#$),$}[F]($,y,M){return{type:"union",fieldName:$,propertyName:M.toCamelCase?s($):$,elseConditionalFnRefId:y.trackConditional(this.#$),conditions:this.#g.map((q)=>q[F]($,y,M))}}},Mq=class{#g;#$;constructor(g,$){this.#g=$,this.#$=g}[F](g,$,y){return{conditionalFnRefId:$.trackConditional(this.#$),schema:this.#g[F](g,$,y)}}};function k1(g){return new yq(g)}k1.if=function g($,y){return new Mq($,y)};k1.else=function g($){return new Mq(()=>!0,$)};var wg=class extends o0{optional(){return new Ez(this)}nullable(){return new jz(this)}},jz=class g extends wg{#g;constructor($){super();this.#g=$}clone(){return new g(this.#g.clone())}[F]($,y,M){let q=this.#g[F]($,y,M);if(q.type!=="union")q.allowNull=!0;return q}},Ez=class g extends wg{#g;validations;constructor($,y){super();this.#g=$,this.validations=y||[]}cloneValidations(){return this.validations.map(($)=>{return{options:$.options,rule:$.rule}})}compileValidations($){return this.validations.map((y)=>{return{ruleFnId:$.track({validator:y.rule.validator,options:y.options}),implicit:y.rule.implicit,isAsync:y.rule.isAsync}})}use($){return this.validations.push(I0 in $?$[I0]():$),this}requiredWhen($,y,M){if(typeof $==="function")return this.use(_0($));let q;switch(y){case"=":q=(J)=>J===M;break;case"!=":q=(J)=>J!==M;break;case"in":q=(J)=>M.includes(J);break;case"notIn":q=(J)=>!M.includes(J);break;case">":q=(J)=>J>M;break;case"<":q=(J)=>J<M;break;case">=":q=(J)=>J>=M;break;case"<=":q=(J)=>J<=M}return this.use(_0((J)=>{let Y=A.getNestedValue($,J);return q(Y)}))}requiredIfExists($){let y=Array.isArray($)?$:[$];return this.use(_0((M)=>{return y.every((q)=>{return A.exists(A.getNestedValue(q,M))})}))}requiredIfAnyExists($){return this.use(_0((y)=>{return $.some((M)=>A.exists(A.getNestedValue(M,y)))}))}requiredIfMissing($){let y=Array.isArray($)?$:[$];return this.use(_0((M)=>{return y.every((q)=>A.isMissing(A.getNestedValue(q,M)))}))}requiredIfAnyMissing($){return this.use(_0((y)=>{return $.some((M)=>A.isMissing(A.getNestedValue(M,y)))}))}clone(){return new g(this.#g.clone(),this.cloneValidations())}[F]($,y,M){let q=this.#g[F]($,y,M);if(q.type!=="union")q.isOptional=!0,q.validations=q.validations.concat(this.compileValidations(y));return q}},_g=class extends wg{options;validations;constructor(g,$){super();this.options=g||{bail:!0,allowNull:!1,isOptional:!1},this.validations=$||[]}cloneValidations(){return this.validations.map((g)=>{return{options:g.options,rule:g.rule}})}cloneOptions(){return{...this.options}}compileValidations(g){return this.validations.map(($)=>{return{ruleFnId:g.track({validator:$.rule.validator,options:$.options}),implicit:$.rule.implicit,isAsync:$.rule.isAsync}})}parse(g){return this.options.parse=g,this}use(g){return this.validations.push(I0 in g?g[I0]():g),this}bail(g){return this.options.bail=g,this}},qq=class g extends _g{#g;#$=!1;[X0]="vine.array";[U0]=($)=>{return Array.isArray($)};constructor($,y,M){super(y,M);this.#g=$}allowUnknownProperties(){return this.#$=!0,this}clone(){let $=new g(this.#g.map((y)=>y.clone()),this.cloneOptions(),this.cloneValidations());if(this.#$)$.allowUnknownProperties();return $}[F]($,y,M){return{type:"tuple",fieldName:$,propertyName:M.toCamelCase?s($):$,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,allowUnknownProperties:this.#$,parseFnId:this.options.parse?y.trackParser(this.options.parse):void 0,validations:this.compileValidations(y),properties:this.#g.map((q,J)=>q[F](String(J),y,M))}}},tM=U((g,$,y)=>{if(!y.isValid)return;if(g.length<$.min)y.report(Q["array.minLength"],"array.minLength",y,$)}),iM=U((g,$,y)=>{if(!y.isValid)return;if(g.length>$.max)y.report(Q["array.maxLength"],"array.maxLength",y,$)}),aM=U((g,$,y)=>{if(!y.isValid)return;if(g.length!==$.size)y.report(Q["array.fixedLength"],"array.fixedLength",y,$)}),pM=U((g,$,y)=>{if(!y.isValid)return;if(g.length<=0)y.report(Q.notEmpty,"notEmpty",y)}),lM=U((g,$,y)=>{if(!y.isValid)return;if(!A.isDistinct(g,$.fields))y.report(Q.distinct,"distinct",y,$)}),oM=U((g,$,y)=>{if(!y.isValid)return;y.mutate(g.filter((M)=>A.exists(M)&&M!==""),y)}),Jq=class g extends _g{static rules={compact:oM,notEmpty:pM,distinct:lM,minLength:tM,maxLength:iM,fixedLength:aM};#g;[X0]="vine.array";[U0]=($)=>{return Array.isArray($)};constructor($,y,M){super(y,M);this.#g=$}minLength($){return this.use(tM({min:$}))}maxLength($){return this.use(iM({max:$}))}fixedLength($){return this.use(aM({size:$}))}notEmpty(){return this.use(pM())}distinct($){return this.use(lM({fields:$}))}compact(){return this.use(oM())}clone(){return new g(this.#g.clone(),this.cloneOptions(),this.cloneValidations())}[F]($,y,M){return{type:"array",fieldName:$,propertyName:M.toCamelCase?s($):$,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,each:this.#g[F]("*",y,M),parseFnId:this.options.parse?y.trackParser(this.options.parse):void 0,validations:this.compileValidations(y)}}},Fz=class g extends wg{#g;[X0]="types.object";[U0]=($)=>{return $!==null&&typeof $==="object"&&!Array.isArray($)};constructor($){super();this.#g=$}clone(){return new g(this.#g.clone())}[F]($,y,M){return M.toCamelCase=!0,this.#g[F]($,y,M)}},Yq=class g extends _g{#g;#$=[];#y=!1;[X0]="vine.object";[U0]=($)=>{return $!==null&&typeof $==="object"&&!Array.isArray($)};constructor($,y,M){if(!$)throw new Error('Missing properties for "vine.object". Use an empty object if you do not want to validate any specific fields');super(y,M);this.#g=$}getProperties(){return Object.keys(this.#g).reduce(($,y)=>{return $[y]=this.#g[y].clone(),$},{})}allowUnknownProperties(){return this.#y=!0,this}merge($){return this.#$.push($),this}clone(){let $=new g(this.getProperties(),this.cloneOptions(),this.cloneValidations());if(this.#$.forEach((y)=>$.merge(y)),this.#y)$.allowUnknownProperties();return $}toCamelCase(){return new Fz(this)}[F]($,y,M){return{type:"object",fieldName:$,propertyName:M.toCamelCase?s($):$,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,parseFnId:this.options.parse?y.trackParser(this.options.parse):void 0,allowUnknownProperties:this.#y,validations:this.compileValidations(y),properties:Object.keys(this.#g).map((q)=>{return this.#g[q][F](q,y,M)}),groups:this.#$.map((q)=>{return q[F](y,M)})}}},sM=U((g,$,y)=>{if(!y.isValid)return;if(Object.keys(g).length<$.min)y.report(Q["record.minLength"],"record.minLength",y,$)}),eM=U((g,$,y)=>{if(!y.isValid)return;if(Object.keys(g).length>$.max)y.report(Q["record.maxLength"],"record.maxLength",y,$)}),g2=U((g,$,y)=>{if(!y.isValid)return;if(Object.keys(g).length!==$.size)y.report(Q["record.fixedLength"],"record.fixedLength",y,$)}),$2=U((g,$,y)=>{if(!y.isValid)return;$(Object.keys(g),y)}),Zq=class g extends _g{static rules={maxLength:eM,minLength:sM,fixedLength:g2,validateKeys:$2};#g;[X0]="vine.object";[U0]=($)=>{return $!==null&&typeof $==="object"&&!Array.isArray($)};constructor($,y,M){super(y,M);this.#g=$}minLength($){return this.use(sM({min:$}))}maxLength($){return this.use(eM({max:$}))}fixedLength($){return this.use(g2({size:$}))}validateKeys(...$){return this.use($2(...$))}clone(){return new g(this.#g.clone(),this.cloneOptions(),this.cloneValidations())}[F]($,y,M){return{type:"record",fieldName:$,propertyName:M.toCamelCase?s($):$,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,each:this.#g[F]("*",y,M),parseFnId:this.options.parse?y.trackParser(this.options.parse):void 0,validations:this.compileValidations(y)}}},y2=U((g,$,y)=>{if(typeof g!=="string")y.report(Q.string,"string",y)}),M2=U((g,$,y)=>{if(!y.isValid)return;if(!A.isEmail(g,$))y.report(Q.email,"email",y)}),q2=U((g,$,y)=>{if(!y.isValid)return;let M=$&&typeof $==="function"?$(y):$,q=M?.locale||"any";if(!A.isMobilePhone(g,q,M))y.report(Q.mobile,"mobile",y)}),J2=U((g,$,y)=>{if(!y.isValid)return;if(!A.isIP(g,$?.version))y.report(Q.ipAddress,"ipAddress",y)}),Y2=U((g,$,y)=>{if(!y.isValid)return;if(!$.test(g))y.report(Q.regex,"regex",y)}),Z2=U((g,$,y)=>{if(!y.isValid)return;if(!A.isHexColor(g))y.report(Q.hexCode,"hexCode",y)}),z2=U((g,$,y)=>{if(!y.isValid)return;if(!A.isURL(g,$))y.report(Q.url,"url",y)}),K2=U(async(g,$,y)=>{if(!y.isValid)return;if(!await A.isActiveURL(g))y.report(Q.activeUrl,"activeUrl",y)}),H2=U((g,$,y)=>{if(!y.isValid)return;let M="a-zA-Z";if($){if($.allowSpaces)M+="\\s";if($.allowDashes)M+="-";if($.allowUnderscores)M+="_"}if(!new RegExp(`^[${M}]+$`).test(g))y.report(Q.alpha,"alpha",y)}),D2=U((g,$,y)=>{if(!y.isValid)return;let M="a-zA-Z0-9";if($){if($.allowSpaces)M+="\\s";if($.allowDashes)M+="-";if($.allowUnderscores)M+="_"}if(!new RegExp(`^[${M}]+$`).test(g))y.report(Q.alphaNumeric,"alphaNumeric",y)}),O2=U((g,$,y)=>{if(!y.isValid)return;if(g.length<$.min)y.report(Q.minLength,"minLength",y,$)}),X2=U((g,$,y)=>{if(!y.isValid)return;if(g.length>$.max)y.report(Q.maxLength,"maxLength",y,$)}),G2=U((g,$,y)=>{if(!y.isValid)return;if(g.length!==$.size)y.report(Q.fixedLength,"fixedLength",y,$)}),W2=U((g,$,y)=>{if(!y.isValid)return;if(!g.endsWith($.substring))y.report(Q.endsWith,"endsWith",y,$)}),x2=U((g,$,y)=>{if(!y.isValid)return;if(!g.startsWith($.substring))y.report(Q.startsWith,"startsWith",y,$)}),Q2=U((g,$,y)=>{if(!y.isValid)return;if(A.getNestedValue($.otherField,y)!==g){y.report(Q.sameAs,"sameAs",y,$);return}}),w2=U((g,$,y)=>{if(!y.isValid)return;if(A.getNestedValue($.otherField,y)===g){y.report(Q.notSameAs,"notSameAs",y,$);return}}),_2=U((g,$,y)=>{if(!y.isValid)return;let M=$?.confirmationField||`${y.name}_confirmation`;if(y.parent[M]!==g){y.report(Q.confirmed,"confirmed",y,{otherField:M});return}}),U2=U((g,$,y)=>{if(!y.isValid)return;y.mutate(g.trim(),y)}),L2=U((g,$,y)=>{if(!y.isValid)return;y.mutate(Kq.default.default(g,$),y)}),P2=U((g,$,y)=>{if(!y.isValid)return;y.mutate(g.toLocaleUpperCase($),y)}),B2=U((g,$,y)=>{if(!y.isValid)return;y.mutate(g.toLocaleLowerCase($),y)}),C2=U((g,$,y)=>{if(!y.isValid)return;y.mutate(s(g),y)}),T2=U((g,$,y)=>{if(!y.isValid)return;y.mutate(zq.default.default(g),y)}),k2=U((g,$,y)=>{if(!y.isValid)return;y.mutate(U1(g,$),y)}),A2=U((g,$,y)=>{if(!y.isValid)return;if(!(typeof $.choices==="function"?$.choices(y):$.choices).includes(g)){y.report(Q.in,"in",y,$);return}}),V2=U((g,$,y)=>{if(!y.isValid)return;if((typeof $.list==="function"?$.list(y):$.list).includes(g)){y.report(Q.notIn,"notIn",y,$);return}}),m2=U((g,$,y)=>{if(!y.isValid)return;let M=$?typeof $==="function"?$(y)?.provider||[]:$.provider:[];if(!M.length){if(!A.isCreditCard(g))y.report(Q.creditCard,"creditCard",y,{providersList:"credit"})}else if(!M.find((J)=>A.isCreditCard(g,{provider:J})))y.report(Q.creditCard,"creditCard",y,{providers:M,providersList:M.join("/")})}),I2=U((g,$,y)=>{if(!y.isValid)return;let M=typeof $==="function"?$(y).countryCode:$.countryCode;if(!M.find((J)=>A.isPassportNumber(g,J)))y.report(Q.passport,"passport",y,{countryCodes:M})}),j2=U((g,$,y)=>{if(!y.isValid)return;let M=$?typeof $==="function"?$(y)?.countryCode||[]:$.countryCode:[];if(!M.length){if(!A.isPostalCode(g,"any"))y.report(Q.postalCode,"postalCode",y)}else if(!M.find((J)=>A.isPostalCode(g,J)))y.report(Q.postalCode,"postalCode",y,{countryCodes:M})}),E2=U((g,$,y)=>{if(!y.isValid)return;if(!$||!$.version){if(!A.isUUID(g))y.report(Q.uuid,"uuid",y)}else if(!$.version.find((q)=>A.isUUID(g,q)))y.report(Q.uuid,"uuid",y,$)}),F2=U((g,$,y)=>{if(!y.isValid)return;if(!A.isULID(g))y.report(Q.ulid,"ulid",y)}),h2=U((g,$,y)=>{if(!y.isValid)return;if(!A.isAscii(g))y.report(Q.ascii,"ascii",y)}),S2=U((g,$,y)=>{if(!y.isValid)return;if(!A.isIBAN(g))y.report(Q.iban,"iban",y)}),u2=U((g,$,y)=>{if(!y.isValid)return;if(!A.isJWT(g))y.report(Q.jwt,"jwt",y)}),N2=U((g,$,y)=>{if(!y.isValid)return;if(!A.isLatLong(g))y.report(Q.coordinates,"coordinates",y)}),D$=class g extends T0{static rules={in:A2,jwt:u2,url:z2,iban:S2,uuid:E2,ulid:F2,trim:U2,email:M2,alpha:H2,ascii:h2,notIn:V2,regex:Y2,escape:T2,sameAs:Q2,mobile:q2,string:y2,hexCode:Z2,passport:I2,endsWith:W2,confirmed:_2,activeUrl:K2,minLength:O2,notSameAs:w2,maxLength:X2,ipAddress:J2,creditCard:m2,postalCode:j2,startsWith:x2,toUpperCase:P2,toLowerCase:B2,toCamelCase:C2,fixedLength:G2,coordinates:N2,normalizeUrl:k2,alphaNumeric:D2,normalizeEmail:L2};[L0]="string";[X0]="vine.string";[U0]=($)=>{return typeof $==="string"};constructor($,y){super($,y||[y2()])}url(...$){return this.use(z2(...$))}activeUrl(){return this.use(K2())}email(...$){return this.use(M2(...$))}mobile(...$){return this.use(q2(...$))}ipAddress($){return this.use(J2($?{version:$}:void 0))}hexCode(){return this.use(Z2())}regex($){return this.use(Y2($))}alpha($){return this.use(H2($))}alphaNumeric($){return this.use(D2($))}minLength($){return this.use(O2({min:$}))}maxLength($){return this.use(X2({max:$}))}fixedLength($){return this.use(G2({size:$}))}confirmed($){return this.use(_2($))}trim(){return this.use(U2())}normalizeEmail($){return this.use(L2($))}toUpperCase(){return this.use(P2())}toLowerCase(){return this.use(B2())}toCamelCase(){return this.use(C2())}escape(){return this.use(T2())}normalizeUrl(...$){return this.use(k2(...$))}startsWith($){return this.use(x2({substring:$}))}endsWith($){return this.use(W2({substring:$}))}sameAs($){return this.use(Q2({otherField:$}))}notSameAs($){return this.use(w2({otherField:$}))}in($){return this.use(A2({choices:$}))}notIn($){return this.use(V2({list:$}))}creditCard(...$){return this.use(m2(...$))}passport(...$){return this.use(I2(...$))}postalCode(...$){return this.use(j2(...$))}uuid(...$){return this.use(E2(...$))}ulid(){return this.use(F2())}ascii(){return this.use(h2())}iban(){return this.use(S2())}jwt(){return this.use(u2())}coordinates(){return this.use(N2())}clone(){return new g(this.cloneOptions(),this.cloneValidations())}},R2=U((g,$,y)=>{let M=$.strict?g:A.asNumber(g);if(typeof M!=="number"||Number.isNaN(M)||M===Number.POSITIVE_INFINITY||M===Number.NEGATIVE_INFINITY){y.report(Q.number,"number",y);return}y.mutate(M,y)}),b2=U((g,$,y)=>{if(!y.isValid)return;if(g<$.min)y.report(Q.min,"min",y,$)}),n2=U((g,$,y)=>{if(!y.isValid)return;if(g>$.max)y.report(Q.max,"max",y,$)}),c2=U((g,$,y)=>{if(!y.isValid)return;if(g<$.min||g>$.max)y.report(Q.range,"range",y,$)}),v2=U((g,$,y)=>{if(!y.isValid)return;if(g<0)y.report(Q.positive,"positive",y)}),r2=U((g,$,y)=>{if(!y.isValid)return;if(g>=0)y.report(Q.negative,"negative",y)}),f2=U((g,$,y)=>{if(!y.isValid)return;if(!A.isDecimal(String(g),{force_decimal:$.range[0]!==0,decimal_digits:$.range.join(",")}))y.report(Q.decimal,"decimal",y,{digits:$.range.join("-")})}),d2=U((g,$,y)=>{if(!y.isValid)return;if(!Number.isInteger(g))y.report(Q.withoutDecimals,"withoutDecimals",y)}),t2=U((g,$,y)=>{if(!y.isValid)return;if(!$.values.includes(g))y.report(Q["number.in"],"in",y,$)}),O$=class g extends T0{static rules={in:t2,max:n2,min:b2,range:c2,number:R2,decimal:f2,negative:r2,positive:v2,withoutDecimals:d2};[L0]="number";[X0]="vine.number";[U0]=($)=>{let y=A.asNumber($);return!Number.isNaN(y)};constructor($,y){super($,y||[R2($||{})])}min($){return this.use(b2({min:$}))}max($){return this.use(n2({max:$}))}range($){return this.use(c2({min:$[0],max:$[1]}))}positive(){return this.use(v2())}negative(){return this.use(r2())}decimal($){return this.use(f2({range:Array.isArray($)?$:[$]}))}withoutDecimals(){return this.use(d2())}clone(){return new g(this.cloneOptions(),this.cloneValidations())}in($){return this.use(t2({values:$}))}},i2=U((g,$,y)=>{let M=$.strict===!0?g:A.asBoolean(g);if(typeof M!=="boolean"){y.report(Q.boolean,"boolean",y);return}y.mutate(M,y)}),X$=class g extends T0{static rules={boolean:i2};[L0]="boolean";[X0]="vine.boolean";[U0]=($)=>{return typeof(this.options.strict===!0?$:A.asBoolean($))==="boolean"};constructor($,y){super($,y||[i2($||{})])}clone(){return new g(this.cloneOptions(),this.cloneValidations())}},a2=U((g,$,y)=>{let M=g;if(typeof $.expectedValue==="boolean")M=A.asBoolean(g);else if(typeof $.expectedValue==="number")M=A.asNumber(g);if(M!==$.expectedValue){y.report(Q.literal,"literal",y,$);return}y.mutate(M,y)}),Hq=class g extends T0{static rules={equals:a2};#g;[L0]="literal";constructor($,y,M){super(y,M||[a2({expectedValue:$})]);this.#g=$}clone(){return new g(this.#g,this.cloneOptions(),this.cloneValidations())}},hz=["on","1","yes","true",!0,1],p2=U((g,$,y)=>{if(!hz.includes(g))y.report(Q.accepted,"accepted",y)}),Dq=class g extends T0{static rules={accepted:p2};[L0]="checkbox";constructor($,y){super($,y||[p2()])}clone(){return new g(this.cloneOptions(),this.cloneValidations())}},Sz=class g{#g;#$=($,y)=>{y.report(Q.unionGroup,"unionGroup",y)};constructor($){this.#g=$}clone(){let $=new g(this.#g);return $.otherwise(this.#$),$}otherwise($){return this.#$=$,this}[F]($,y){return{type:"group",elseConditionalFnRefId:$.trackConditional(this.#$),conditions:this.#g.map((M)=>M[F]($,y))}}},Oq=class{#g;#$;constructor(g,$){this.#g=$,this.#$=g}[F](g,$){return{schema:{type:"sub_object",properties:Object.keys(this.#g).map((y)=>{return this.#g[y][F](y,g,$)}),groups:[]},conditionalFnRefId:g.trackConditional(this.#$)}}};function A1(g){return new Sz(g)}A1.if=function g($,y){return new Oq($,y)};A1.else=function g($){return new Oq(()=>!0,$)};var Xq=class g extends T0{static rules={enum:z$};#g;[L0]="enum";constructor($,y,M){super(y,M||[z$({choices:Object.values($)})]);this.#g=$}clone(){return new g(this.#g,this.cloneOptions(),this.cloneValidations())}},uz=class g{#g;#$=($,y)=>{y.report(Q.unionOfTypes,"unionOfTypes",y)};constructor($){this.#g=$}otherwise($){return this.#$=$,this}clone(){let $=new g(this.#g);return $.otherwise(this.#$),$}[F]($,y,M){return{type:"union",fieldName:$,propertyName:M.toCamelCase?s($):$,elseConditionalFnRefId:y.trackConditional(this.#$),conditions:this.#g.map((q)=>{return{conditionalFnRefId:y.trackConditional((J,Y)=>{return q[U0](J,Y)}),schema:q[F]($,y,M)}})}}},Nz=class extends o0{group=A1;union=k1;string(){return new D$}boolean(g){return new X$(g)}accepted(){return new Dq}number(g){return new O$(g)}date(g){return new T1(g)}literal(g){return new Hq(g)}object(g){return new Yq(g)}array(g){return new Jq(g)}tuple(g){return new qq(g)}record(g){return new Zq(g)}enum(g){if(Array.isArray(g)||typeof g==="function")return new H$(g);return new Xq(g)}any(){return new o2}unionOfTypes(g){let $=new Set;return g.forEach((y)=>{if(!y[U0]||!y[X0])throw new Error(`Cannot use "${y.constructor.name}". The schema type is not compatible for use with "vine.unionOfTypes"`);if($.has(y[X0]))throw new Error(`Cannot use duplicate schema "${y[X0]}". "vine.unionOfTypes" needs distinct schema types only`);$.add(y[X0])}),$.clear(),new uz(g)}},Rz={required:Q.required,array:Q.array,object:Q.object},C1=class{#g;messagesProvider;errorReporter;#$(g){let $=EM();return{compilerNode:{type:"root",schema:g[F]("",$,{toCamelCase:!1})},refs:$.toJSON()}}constructor(g,$){let{compilerNode:y,refs:M}=this.#$(g);this.#g={schema:y,refs:M};let q=$.metaDataValidator,J=new B1(y,{convertEmptyStringsToNull:$.convertEmptyStringsToNull,messages:Rz}).compile();if(this.errorReporter=$.errorReporter,this.messagesProvider=$.messagesProvider,q)this.validate=(Y,Z)=>{let z=Z??{},w=z.meta??{},K=z.errorReporter??this.errorReporter,L=z.messagesProvider??this.messagesProvider;return q(w),J(Y,w,M,L,K())};else this.validate=(Y,Z)=>{let z=Z??{},w=z.meta??{},K=z.errorReporter??this.errorReporter,L=z.messagesProvider??this.messagesProvider;return J(Y,w,M,L,K())}}async tryValidate(g,...[$]){try{return[null,await this.validate(g,$)]}catch(y){if(y instanceof Z1)return[y,null];throw y}}toJSON(){let{schema:g,refs:$}=this.#g;return{schema:structuredClone(g),refs:$}}},Gq=class extends Nz{messagesProvider=new Gg(Q,GM);errorReporter=()=>new z1;convertEmptyStringsToNull=!1;helpers=A;createRule=U;compile(g){return new C1(g,{convertEmptyStringsToNull:this.convertEmptyStringsToNull,messagesProvider:this.messagesProvider,errorReporter:this.errorReporter})}withMetaData(g){return{compile:($)=>{return new C1($,{convertEmptyStringsToNull:this.convertEmptyStringsToNull,messagesProvider:this.messagesProvider,errorReporter:this.errorReporter,metaDataValidator:g})}}}validate(g){return this.compile(g.schema).validate(g.data,g)}tryValidate(g){return this.compile(g.schema).tryValidate(g.data,g)}},FO=new Gq;import{path as MX}from"@stacksjs/path";var XJ=u(KJ(),1);class Vg{static isTestEnvironment=!1;static shouldExitProcess=!0;static handle(g,$){if(this.shouldExitProcess=$?.shouldExit!==!1,$?.silent!==!0)this.writeErrorToConsole(g);let y;if($?.message)y=$.message;else if(g instanceof Error)y=g.message;else if(typeof g==="string")y=g;else y=JSON.stringify(g);let M=new Error(y);if(g instanceof Error)Object.assign(M,g);return this.writeErrorToFile(M).catch((q)=>console.error(q)),M}static handleError(g,$){return this.handle(g,$),g}static async writeErrorToFile(g){if(!(g instanceof Error)){console.error("Error is not an instance of Error:",g);return}let $=`[${new Date().toISOString()}] ${g.name}: ${g.message}
|
|
131
|
-
`,y=Ag.logsPath("stacks.log")??Ag.logsPath("errors.log");try{await OJ(Ag.dirname(y),{recursive:!0}),await DJ(y,$)}catch(M){console.error("Failed to write to error file:",M)}}static writeErrorToConsole(g){console.error(g);let $=typeof g==="string"?g:g instanceof Error?g.message:JSON.stringify(g);if($.includes("bunx --bun cdk destroy")||$===`Failed to execute command: ${HJ("bunx --bun eslint . --fix")}`||$===`Failed to execute command: ${HJ("bun storage/framework/core/actions/src/lint/fix.ts")}`){if(!this.isTestEnvironment)console.log("No need to worry. The edge function is currently being destroyed. Please run `buddy undeploy` shortly again, and continue doing so until it succeeds running."),console.log("Hoping to see you back soon!")}if(this.shouldExitProcess)gH.exit(1)}}var GJ="storage/logs/stacks.log";function gG(g){GJ=g}async function yH(g,$){let M=`[${new Date().toISOString()}] ${g}
|
|
132
|
-
`,q=$?.logFile??GJ,J=e4(q);if(!XJ.default.existsSync(J))await OJ(J,{recursive:!0});await DJ(q,M)}function $G(g,$){let y,M;if($&&typeof $==="object"&&!("shouldExit"in $)&&!("silent"in $)&&!("message"in $))M=$,$=void 0;if($&&"message"in $)y=$.message;else if(a1(g))y=g;else if(g instanceof Error)y=g.stack||g.message;else y=String(g);let q=`ERROR: ${$H(y)}`;if(M)q+=`
|
|
133
|
-
Context: ${JSON.stringify(M,null,2)}`;return yH(q),Vg.handle(g,$)}class xq extends Error{status;constructor(g,$){super($);this.status=g;this.name="Server Error!"}}class MH extends Error{status;constructor(g,$){super($);this.status=g;this.name="ModelNotFoundException"}}function YG(g,$,y){try{let M=g();if(M instanceof Promise)return M.catch((q)=>{if(y)y(Vg.handle(q));return $});return M}catch(M){if(y)y(Vg.handle(M));return $}}var qH={withStackTrace:!1},QJ=(g,$,y=qH)=>{let M=$.isOk()?{type:"Ok",value:$.value}:{type:"Err",value:$.error},q=y.withStackTrace?new Error().stack:void 0;return{data:M,message:g,stack:q}};function d0(g,$,y,M){function q(J){return J instanceof y?J:new y(function(Y){Y(J)})}return new(y||(y=Promise))(function(J,Y){function Z(K){try{w(M.next(K))}catch(L){Y(L)}}function z(K){try{w(M.throw(K))}catch(L){Y(L)}}function w(K){K.done?J(K.value):q(K.value).then(Z,z)}w((M=M.apply(g,$||[])).next())})}function WJ(g){var $=typeof Symbol==="function"&&Symbol.iterator,y=$&&g[$],M=0;if(y)return y.call(g);if(g&&typeof g.length==="number")return{next:function(){if(g&&M>=g.length)g=void 0;return{value:g&&g[M++],done:!g}}};throw new TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")}function A0(g){return this instanceof A0?(this.v=g,this):new A0(g)}function xJ(g,$,y){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var M=y.apply(g,$||[]),q,J=[];return q=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),Z("next"),Z("throw"),Z("return",Y),q[Symbol.asyncIterator]=function(){return this},q;function Y(G){return function(H){return Promise.resolve(H).then(G,L)}}function Z(G,H){if(M[G]){if(q[G]=function(V){return new Promise(function(m,I){J.push([G,V,m,I])>1||z(G,V)})},H)q[G]=H(q[G])}}function z(G,H){try{w(M[G](H))}catch(V){C(J[0][3],V)}}function w(G){G.value instanceof A0?Promise.resolve(G.value.v).then(K,L):C(J[0][2],G)}function K(G){z("next",G)}function L(G){z("throw",G)}function C(G,H){if(G(H),J.shift(),J.length)z(J[0][0],J[0][1])}}function JH(g){var $,y;return $={},M("next"),M("throw",function(q){throw q}),M("return"),$[Symbol.iterator]=function(){return this},$;function M(q,J){$[q]=g[q]?function(Y){return(y=!y)?{value:A0(g[q](Y)),done:!1}:J?J(Y):Y}:J}}function YH(g){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var $=g[Symbol.asyncIterator],y;return $?$.call(g):(g=typeof WJ==="function"?WJ(g):g[Symbol.iterator](),y={},M("next"),M("throw"),M("return"),y[Symbol.asyncIterator]=function(){return this},y);function M(J){y[J]=g[J]&&function(Y){return new Promise(function(Z,z){Y=g[J](Y),q(Z,z,Y.done,Y.value)})}}function q(J,Y,Z,z){Promise.resolve(z).then(function(w){J({value:w,done:Z})},Y)}}class f{constructor(g){this._promise=g}static fromSafePromise(g){let $=g.then((y)=>new x0(y));return new f($)}static fromPromise(g,$){let y=g.then((M)=>new x0(M)).catch((M)=>new Q0($(M)));return new f(y)}static fromThrowable(g,$){return(...y)=>{return new f((()=>d0(this,void 0,void 0,function*(){try{return new x0(yield g(...y))}catch(M){return new Q0($?$(M):M)}}))())}}static combine(g){return HH(g)}static combineWithAllErrors(g){return DH(g)}map(g){return new f(this._promise.then(($)=>d0(this,void 0,void 0,function*(){if($.isErr())return new Q0($.error);return new x0(yield g($.value))})))}andThrough(g){return new f(this._promise.then(($)=>d0(this,void 0,void 0,function*(){if($.isErr())return new Q0($.error);let y=yield g($.value);if(y.isErr())return new Q0(y.error);return new x0($.value)})))}andTee(g){return new f(this._promise.then(($)=>d0(this,void 0,void 0,function*(){if($.isErr())return new Q0($.error);try{yield g($.value)}catch(y){}return new x0($.value)})))}orTee(g){return new f(this._promise.then(($)=>d0(this,void 0,void 0,function*(){if($.isOk())return new x0($.value);try{yield g($.error)}catch(y){}return new Q0($.error)})))}mapErr(g){return new f(this._promise.then(($)=>d0(this,void 0,void 0,function*(){if($.isOk())return new x0($.value);return new Q0(yield g($.error))})))}andThen(g){return new f(this._promise.then(($)=>{if($.isErr())return new Q0($.error);let y=g($.value);return y instanceof f?y._promise:y}))}orElse(g){return new f(this._promise.then(($)=>d0(this,void 0,void 0,function*(){if($.isErr())return g($.error);return new x0($.value)})))}match(g,$){return this._promise.then((y)=>y.match(g,$))}unwrapOr(g){return this._promise.then(($)=>$.unwrapOr(g))}safeUnwrap(){return xJ(this,arguments,function*g(){return yield A0(yield A0(yield*JH(YH(yield A0(this._promise.then(($)=>$.safeUnwrap()))))))})}then(g,$){return this._promise.then(g,$)}[Symbol.asyncIterator](){return xJ(this,arguments,function*g(){let $=yield A0(this._promise);if($.isErr())yield yield A0(mg($.error));return yield A0($.value)})}}function ZH(g){return new f(Promise.resolve(new x0(g)))}function mg(g){return new f(Promise.resolve(new Q0(g)))}var{fromPromise:zH,fromSafePromise:KH,fromThrowable:zG}=f,wJ=(g)=>{let $=E0([]);for(let y of g)if(y.isErr()){$=B0(y.error);break}else $.map((M)=>M.push(y.value));return $},HH=(g)=>f.fromSafePromise(Promise.all(g)).andThen(wJ),_J=(g)=>{let $=E0([]);for(let y of g)if(y.isErr()&&$.isErr())$.error.push(y.error);else if(y.isErr()&&$.isOk())$=B0([y.error]);else if(y.isOk()&&$.isOk())$.value.push(y.value);return $},DH=(g)=>f.fromSafePromise(Promise.all(g)).andThen(_J);var Ig=void 0;(function(g){function $(q,J){return(...Y)=>{try{let Z=q(...Y);return E0(Z)}catch(Z){return B0(J?J(Z):Z)}}}g.fromThrowable=$;function y(q){return wJ(q)}g.combine=y;function M(q){return _J(q)}g.combineWithAllErrors=M})(Ig||(Ig={}));function E0(g){return new x0(g)}function B0(g){return new Q0(g)}class x0{constructor(g){this.value=g}isOk(){return!0}isErr(){return!this.isOk()}map(g){return E0(g(this.value))}mapErr(g){return E0(this.value)}andThen(g){return g(this.value)}andThrough(g){return g(this.value).map(($)=>this.value)}andTee(g){try{g(this.value)}catch($){}return E0(this.value)}orTee(g){return E0(this.value)}orElse(g){return E0(this.value)}asyncAndThen(g){return g(this.value)}asyncAndThrough(g){return g(this.value).map(()=>this.value)}asyncMap(g){return f.fromSafePromise(g(this.value))}unwrapOr(g){return this.value}match(g,$){return g(this.value)}safeUnwrap(){let g=this.value;return function*(){return g}()}_unsafeUnwrap(g){return this.value}_unsafeUnwrapErr(g){throw QJ("Called `_unsafeUnwrapErr` on an Ok",this,g)}*[Symbol.iterator](){return this.value}}class Q0{constructor(g){this.error=g}isOk(){return!1}isErr(){return!this.isOk()}map(g){return B0(this.error)}mapErr(g){return B0(g(this.error))}andThrough(g){return B0(this.error)}andTee(g){return B0(this.error)}orTee(g){try{g(this.error)}catch($){}return B0(this.error)}andThen(g){return B0(this.error)}orElse(g){return g(this.error)}asyncAndThen(g){return mg(this.error)}asyncAndThrough(g){return mg(this.error)}asyncMap(g){return mg(this.error)}unwrapOr(g){return g}match(g,$){return $(this.error)}safeUnwrap(){let g=this.error;return function*(){throw yield B0(g),new Error("Do not use this generator out of `safeTry`")}()}_unsafeUnwrap(g){throw QJ("Called `_unsafeUnwrap` on an Err",this,g)}_unsafeUnwrapErr(g){return this.error}*[Symbol.iterator](){let g=this;return yield g,g}}var OH=Ig.fromThrowable;var UJ=Q0,LJ=x0,PJ=f,BJ=B0,CJ=mg;var TJ=zH,kJ=KH,AJ=OH,VJ=E0,mJ=ZH;export{yH as writeToLogFile,gG as setLogPath,YG as rescue,mJ as okAsync,VJ as ok,$G as handleError,AJ as fromThrowable,kJ as fromSafePromise,TJ as fromPromise,CJ as errAsync,BJ as err,PJ as ResultAsync,Ig as Result,LJ as Ok,MH as ModelNotFoundException,xq as HttpError,Vg as ErrorHandler,UJ as Err};
|
|
403
|
+
${this.config.showEnvironment?`
|
|
404
|
+
<div class="card">
|
|
405
|
+
<div class="card-header">⚙️ Environment</div>
|
|
406
|
+
<div class="card-body">
|
|
407
|
+
<table class="info-table">
|
|
408
|
+
<tr><td>Node Version</td><td>${typeof process<"u"?process.version:"N/A"}</td></tr>
|
|
409
|
+
<tr><td>Platform</td><td>${typeof process<"u"?process.platform:"N/A"}</td></tr>
|
|
410
|
+
<tr><td>Architecture</td><td>${typeof process<"u"?process.arch:"N/A"}</td></tr>
|
|
411
|
+
</table>
|
|
412
|
+
</div>
|
|
413
|
+
</div>
|
|
414
|
+
`:""}
|
|
415
|
+
</div>
|
|
416
|
+
</body>
|
|
417
|
+
</html>`}handleError(f,n=500){let l=this.render(f,n);return new Response(l,{status:n,headers:{"Content-Type":"text/html; charset=utf-8"}})}}function V(f){return new W(f)}class T extends Error{status;details;constructor(f,n,l){super(n);this.status=f;if(this.name=t(f),l!==void 0)this.details=l}}function t(f){switch(f){case 400:return"Bad Request";case 401:return"Unauthorized";case 402:return"Payment Required";case 403:return"Forbidden";case 404:return"Not Found";case 405:return"Method Not Allowed";case 408:return"Request Timeout";case 409:return"Conflict";case 410:return"Gone";case 413:return"Payload Too Large";case 415:return"Unsupported Media Type";case 422:return"Unprocessable Entity";case 423:return"Locked";case 425:return"Too Early";case 426:return"Upgrade Required";case 428:return"Precondition Required";case 429:return"Too Many Requests";case 431:return"Request Header Fields Too Large";case 451:return"Unavailable For Legal Reasons";case 500:return"Internal Server Error";case 501:return"Not Implemented";case 502:return"Bad Gateway";case 503:return"Service Unavailable";case 504:return"Gateway Timeout";case 507:return"Insufficient Storage";case 508:return"Loop Detected";case 511:return"Network Authentication Required";default:return f>=400&&f<500?"Client Error":"Server Error"}}class _{handler=V();isDevelopment;constructor(f){if(this.isDevelopment=f?.isDevelopment??!0,f?.config)this.handler=V(f.config);this.handler.setFramework("Stacks")}setRequest(f){return this.handler.setRequest(f),this}setRouting(f){return this.handler.setRouting(f),this}addQuery(f,n,l){return this.handler.addQuery(f,n,l),this}handle(f,n=500){if(this.isDevelopment)return this.handler.handleError(f,n);return new Response(N(n),{status:n,headers:{"Content-Type":"text/html; charset=utf-8"}})}notFound(f){let n=new T(404,f||"The requested resource could not be found.");return this.handle(n,404)}serverError(f){return this.handle(f,500)}forbidden(f){let n=new T(403,f||"You do not have permission to access this resource.");return this.handle(n,403)}unauthorized(f){let n=new T(401,f||"Authentication is required to access this resource.");return this.handle(n,401)}badRequest(f){let n=new T(400,f||"The request was malformed or invalid.");return this.handle(n,400)}validationError(f){let n=new T(422,f||"The request was well-formed but could not be processed.");return this.handle(n,422)}tooManyRequests(f){let n=new T(429,f||"You have exceeded the rate limit.");return this.handle(n,429)}serviceUnavailable(f){let n=new T(503,f||"The service is temporarily unavailable.");return this.handle(n,503)}}function D(f){return new _(f)}function c1(f,n,l){let i=D({isDevelopment:l?.isDevelopment,config:l?.config});if(n)i.setRequest(n);return i.handle(f,l?.status)}function w1(f){let n=D(f);return async(l,i)=>{n.setRequest(i);let v=500;if(l instanceof T)v=l.status;else if("status"in l&&typeof l.status==="number")v=l.status;else if("statusCode"in l&&typeof l.statusCode==="number")v=l.statusCode;return n.handle(l,v)}}class s extends Error{status;constructor(f,n){super(n);this.status=f;this.name="ModelNotFoundException"}}function z1(f,n,l){try{let i=f();if(i instanceof Promise)return i.catch((v)=>{if(l)l(Q.handle(v));return n});return i}catch(i){if(l)l(Q.handle(i));return n}}export{H as writeToLogFile,v1 as setLogPath,z1 as rescue,F1 as renderProductionErrorPage,I1 as renderHttpErrorHints,c1 as renderHttpError,h1 as renderErrorPage,D1 as renderError,$1 as ok,u1 as handleError,Z1 as fromPromise,W1 as errorResponse,w1 as errorMiddleware,Y1 as err,D as createHttpErrorHandler,G1 as createErrorHandler,s as ModelNotFoundException,_ as HttpErrorHandler,T as HttpError,_1 as HTTP_ERRORS,N1 as ErrorPageHandler,Q as ErrorHandler,K1 as ERROR_PAGE_CSS};
|