mirror of
https://github.com/thedotmack/claude-mem
synced 2026-04-26 01:25:10 +02:00
* fix: prevent initialization promise from resolving on failure Background initialization was resolving the promise even when it failed, causing the readiness check to incorrectly indicate the worker was ready. Now the promise stays pending on failure, ensuring /api/readiness continues returning 503 until initialization succeeds. Fixes critical issue #1 from nonsense audit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: improve error handling in context inject and settings update routes * Enhance error handling for ChromaDB failures in SearchManager - Introduced a flag to track ChromaDB failure states. - Updated logging messages to provide clearer feedback on ChromaDB initialization and failure. - Modified the response structure to inform users when semantic search is unavailable due to ChromaDB issues, including installation instructions for UVX/Python. * refactor: remove deprecated silent-debug utility functions * Enhance error handling and validation in hooks - Added validation for required fields in `summary-hook.ts` and `save-hook.ts` to ensure necessary inputs are provided before processing. - Improved error messages for missing `cwd` in `save-hook.ts` and `transcript_path` in `summary-hook.ts`. - Cleaned up code by removing unnecessary error handling logic and directly throwing errors when required fields are missing. - Updated binary file `mem-search.zip` to reflect changes in the plugin. * fix: improve error handling in summary hook to ensure errors are not masked * fix: add error handling for unknown message content format in transcript parser * fix: log error when failing to notify worker of session end * Refactor date formatting functions: move to shared module - Removed redundant date formatting functions from SearchManager.ts. - Consolidated date formatting logic into shared timeline-formatting.ts. - Updated functions to accept both ISO date strings and epoch milliseconds. * Refactor tag stripping functions to extract shared logic - Introduced a new internal function `stripTagsInternal` to handle the common logic for stripping memory tags from both JSON and prompt content. - Updated `stripMemoryTagsFromJson` to utilize the new internal function, simplifying its implementation. - Modified `stripMemoryTagsFromPrompt` to also call `stripTagsInternal`, reducing code duplication and improving maintainability. - Removed redundant type checks and logging from both functions, as they now rely on the internal function for processing. * Refactor settings validation in SettingsRoutes - Consolidated multiple individual setting validations into a single validateSettings method. - Updated handleUpdateSettings to use the new validation method for improved maintainability. - Each setting now has its validation logic encapsulated within validateSettings, ensuring a single source of truth for validation rules. * fix: add error logging to ProcessManager.getPidInfo() Previously getPidInfo() returned null silently for three cases: 1. File not found (expected - no action needed) 2. JSON parse error (corrupted file - now logs warning) 3. Type validation failure (malformed data - now logs warning) This fix adds warning logs for cases 2 and 3 to provide visibility into PID file corruption issues. Logs include context like parsed data structure or error message with file path. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: remove overly defensive try-catch in SessionRoutes Remove unnecessary try-catch block that was masking potential errors when checking file paths for session-memory meta-observations. Property access on parsed JSON objects never throws - existing truthiness checks already safely handle undefined/null values. Issue #12 from nonsense audit: SessionRoutes catch-all exception masking 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: remove redundant try-catch from getWorkerPort() Simplified getWorkerPort() by removing unnecessary try-catch wrapper. SettingsDefaultsManager.loadFromFile() already handles missing files by returning defaults, and .get() never throws - making the catch block completely redundant. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * refactor: eliminate ceremonial wrapper in hook-response.ts Replace buildHookResponse() function with direct constant export. Most hook responses were calling a function just to return the same constant object. Only SessionStart with context needs special handling. Changes: - Export STANDARD_HOOK_RESPONSE constant directly - Simplify createHookResponse() to only handle SessionStart special case - Update all hooks to use STANDARD_HOOK_RESPONSE instead of function call - Eliminate buildHookResponse() function with redundant branching Files modified: - src/hooks/hook-response.ts: Export constant, simplify function - src/hooks/new-hook.ts: Use STANDARD_HOOK_RESPONSE - src/hooks/save-hook.ts: Use STANDARD_HOOK_RESPONSE - src/hooks/summary-hook.ts: Use STANDARD_HOOK_RESPONSE 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: make getWorkerHost() consistent with getWorkerPort() - Use SettingsDefaultsManager.get('CLAUDE_MEM_DATA_DIR') for path resolution instead of hardcoded ~/.claude-mem (supports custom data directories) - Add caching to getWorkerHost() (same pattern as getWorkerPort()) - Update clearPortCache() to also clear host cache - Both functions now have identical patterns: caching, consistent path resolution, and same error handling via SettingsDefaultsManager 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * refactor: inline single-use timeout constants in ProcessManager Remove 6 timeout constants used only once each, inlining their values directly at the point of use. Following YAGNI principle - constants should only exist when used multiple times. Removed constants: - PROCESS_STOP_TIMEOUT_MS (5000ms) - HEALTH_CHECK_TIMEOUT_MS (10000ms) - HEALTH_CHECK_INTERVAL_MS (200ms) - HEALTH_CHECK_FETCH_TIMEOUT_MS (1000ms) - PROCESS_EXIT_CHECK_INTERVAL_MS (100ms) - HTTP_SHUTDOWN_TIMEOUT_MS (2000ms) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: replace overly broad path filter in HTTP logging middleware Replace `req.path.includes('.')` with explicit static file extension checking to prevent incorrectly skipping API endpoint logging. - Add `staticExtensions` array with legitimate asset types - Use `.endsWith()` matching instead of `.includes()` - API endpoints containing periods (if any) now logged correctly - Static assets (.js, .css, .svg, etc.) still skip logging as intended 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * refactor: expand logger.formatTool() to handle all tool types Replace hard-coded tool formatting for 4 tools with comprehensive coverage: File operations (Read, Edit, Write, NotebookEdit): - Consolidated file_path handling for all file operations - Added notebook_path support for NotebookEdit - Shows filename only (not full path) Search tools (Glob, Grep): - Glob: shows pattern - Grep: shows pattern (truncated if > 30 chars) Network tools (WebFetch, WebSearch): - Shows URL or query (truncated if > 40 chars) Meta tools (Task, Skill, LSP): - Task: shows subagent_type or description - Skill: shows skill name - LSP: shows operation type This eliminates the "hard-coded 4 tools" limitation and provides meaningful log output for all tool types. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: remove all truncation from logger.formatTool() Truncation hides critical debugging information. Show everything: - Bash: full command (was truncated at 50 chars) - File operations: full path (was showing filename only) - Grep: full pattern (was truncated at 30 chars) - WebFetch/WebSearch: full URL/query (was truncated at 40 chars) - Task: full description (was truncated at 30 chars) Logs exist to provide complete information. Never hide details. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * refactor: replace array indexing with regex capture for drive letter Use explicit regex capture group to extract Windows drive letter instead of assuming cwd[0] is always the first character. Safer and more explicit. - Changed cwd.match(/^[A-Z]:\\/i) to cwd.match(/^([A-Z]):\\/i) - Extract drive letter from driveMatch[1] instead of cwd[0] - Restructured control flow to avoid nested conditionals 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: return computed values from DataRoutes processing endpoint The handleSetProcessing endpoint was computing queueDepth and activeSessions but not including them in the response. This commit includes all computed values in the API response. - Return queueDepth and activeSessions in /api/processing response - Eliminates dead code pattern where values are computed but unused - API callers can now access these metrics 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: move error handling into SettingsDefaultsManager.loadFromFile() Wrap the entire loadFromFile() method in try-catch so it handles ALL error cases (missing file, corrupted JSON, permission errors, I/O failures) instead of forcing every caller to add redundant try-catch blocks. This follows DRY principle: one function owns error handling, all callers stay simple and clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Refactor hook response handling and optimize token estimation - Removed the HookType and HookResponse types and the createHookResponse function from hook-response.ts to simplify the response handling for hooks. - Introduced a standardized hook response for all hooks in hook-response.ts. - Moved the estimateTokens function from SearchManager.ts to timeline-formatting.ts for better reusability and clarity. - Cleaned up redundant estimateTokens function definitions in SearchManager.ts. --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
17 lines
218 KiB
JavaScript
Executable File
17 lines
218 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
"use strict";var Uo=Object.create;var _a=Object.defineProperty;var Vo=Object.getOwnPropertyDescriptor;var Ho=Object.getOwnPropertyNames;var zo=Object.getPrototypeOf,Wo=Object.prototype.hasOwnProperty;var B=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports),Bo=(a,e)=>{for(var t in e)_a(a,t,{get:e[t],enumerable:!0})},Qo=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ho(e))!Wo.call(a,r)&&r!==t&&_a(a,r,{get:()=>e[r],enumerable:!(s=Vo(e,r))||s.enumerable});return a};var Ea=(a,e,t)=>(t=a!=null?Uo(zo(a)):{},Qo(e||!a||!a.__esModule?_a(t,"default",{value:a,enumerable:!0}):t,a));var nn=B((zt,sn)=>{(function(a,e){typeof zt=="object"&&typeof sn<"u"?e(zt):typeof define=="function"&&define.amd?define(["exports"],e):e(a.URI=a.URI||{})})(zt,(function(a){"use strict";function e(){for(var p=arguments.length,u=Array(p),g=0;g<p;g++)u[g]=arguments[g];if(u.length>1){u[0]=u[0].slice(0,-1);for(var S=u.length-1,b=1;b<S;++b)u[b]=u[b].slice(1,-1);return u[S]=u[S].slice(1),u.join("")}else return u[0]}function t(p){return"(?:"+p+")"}function s(p){return p===void 0?"undefined":p===null?"null":Object.prototype.toString.call(p).split(" ").pop().split("]").shift().toLowerCase()}function r(p){return p.toUpperCase()}function n(p){return p!=null?p instanceof Array?p:typeof p.length!="number"||p.split||p.setInterval||p.call?[p]:Array.prototype.slice.call(p):[]}function l(p,u){var g=p;if(u)for(var S in u)g[S]=u[S];return g}function i(p){var u="[A-Za-z]",g="[\\x0D]",S="[0-9]",b="[\\x22]",N=e(S,"[A-Fa-f]"),Z="[\\x0A]",re="[\\x20]",ne=t(t("%[EFef]"+N+"%"+N+N+"%"+N+N)+"|"+t("%[89A-Fa-f]"+N+"%"+N+N)+"|"+t("%"+N+N)),ye="[\\:\\/\\?\\#\\[\\]\\@]",ee="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",ue=e(ye,ee),_e=p?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",ce=p?"[\\uE000-\\uF8FF]":"[]",ae=e(u,S,"[\\-\\.\\_\\~]",_e),de=t(u+e(u,S,"[\\+\\-\\.]")+"*"),oe=t(t(ne+"|"+e(ae,ee,"[\\:]"))+"*"),wr=t(t("25[0-5]")+"|"+t("2[0-4]"+S)+"|"+t("1"+S+S)+"|"+t("[1-9]"+S)+"|"+S),Ne=t(t("25[0-5]")+"|"+t("2[0-4]"+S)+"|"+t("1"+S+S)+"|"+t("0?[1-9]"+S)+"|0?0?"+S),Fe=t(Ne+"\\."+Ne+"\\."+Ne+"\\."+Ne),le=t(N+"{1,4}"),je=t(t(le+"\\:"+le)+"|"+Fe),Me=t(t(le+"\\:")+"{6}"+je),Ye=t("\\:\\:"+t(le+"\\:")+"{5}"+je),Rr=t(t(le)+"?\\:\\:"+t(le+"\\:")+"{4}"+je),ir=t(t(t(le+"\\:")+"{0,1}"+le)+"?\\:\\:"+t(le+"\\:")+"{3}"+je),dt=t(t(t(le+"\\:")+"{0,2}"+le)+"?\\:\\:"+t(le+"\\:")+"{2}"+je),Tt=t(t(t(le+"\\:")+"{0,3}"+le)+"?\\:\\:"+le+"\\:"+je),Ot=t(t(t(le+"\\:")+"{0,4}"+le)+"?\\:\\:"+je),Qr=t(t(t(le+"\\:")+"{0,5}"+le)+"?\\:\\:"+le),Zr=t(t(t(le+"\\:")+"{0,6}"+le)+"?\\:\\:"),or=t([Me,Ye,Rr,ir,dt,Tt,Ot,Qr,Zr].join("|")),Kr=t(t(ae+"|"+ne)+"+"),ga=t(or+"\\%25"+Kr),Tr=t(or+t("\\%25|\\%(?!"+N+"{2})")+Kr),ko=t("[vV]"+N+"+\\."+e(ae,ee,"[\\:]")+"+"),No=t("\\["+t(Tr+"|"+or+"|"+ko)+"\\]"),xs=t(t(ne+"|"+e(ae,ee))+"*"),ft=t(No+"|"+Fe+"(?!"+xs+")|"+xs),ht=t(S+"*"),ws=t(t(oe+"@")+"?"+ft+t("\\:"+ht)+"?"),pt=t(ne+"|"+e(ae,ee,"[\\:\\@]")),jo=t(pt+"*"),Rs=t(pt+"+"),Lo=t(t(ne+"|"+e(ae,ee,"[\\@]"))+"+"),lr=t(t("\\/"+jo)+"*"),Gr=t("\\/"+t(Rs+lr)+"?"),ya=t(Lo+lr),It=t(Rs+lr),Jr="(?!"+pt+")",Vd=t(lr+"|"+Gr+"|"+ya+"|"+It+"|"+Jr),Yr=t(t(pt+"|"+e("[\\/\\?]",ce))+"*"),mt=t(t(pt+"|[\\/\\?]")+"*"),Ts=t(t("\\/\\/"+ws+lr)+"|"+Gr+"|"+It+"|"+Jr),Fo=t(de+"\\:"+Ts+t("\\?"+Yr)+"?"+t("\\#"+mt)+"?"),Mo=t(t("\\/\\/"+ws+lr)+"|"+Gr+"|"+ya+"|"+Jr),qo=t(Mo+t("\\?"+Yr)+"?"+t("\\#"+mt)+"?"),Hd=t(Fo+"|"+qo),zd=t(de+"\\:"+Ts+t("\\?"+Yr)+"?"),Wd="^("+de+")\\:"+t(t("\\/\\/("+t("("+oe+")@")+"?("+ft+")"+t("\\:("+ht+")")+"?)")+"?("+lr+"|"+Gr+"|"+It+"|"+Jr+")")+t("\\?("+Yr+")")+"?"+t("\\#("+mt+")")+"?$",Bd="^(){0}"+t(t("\\/\\/("+t("("+oe+")@")+"?("+ft+")"+t("\\:("+ht+")")+"?)")+"?("+lr+"|"+Gr+"|"+ya+"|"+Jr+")")+t("\\?("+Yr+")")+"?"+t("\\#("+mt+")")+"?$",Qd="^("+de+")\\:"+t(t("\\/\\/("+t("("+oe+")@")+"?("+ft+")"+t("\\:("+ht+")")+"?)")+"?("+lr+"|"+Gr+"|"+It+"|"+Jr+")")+t("\\?("+Yr+")")+"?$",Zd="^"+t("\\#("+mt+")")+"?$",Kd="^"+t("("+oe+")@")+"?("+ft+")"+t("\\:("+ht+")")+"?$";return{NOT_SCHEME:new RegExp(e("[^]",u,S,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(e("[^\\%\\:]",ae,ee),"g"),NOT_HOST:new RegExp(e("[^\\%\\[\\]\\:]",ae,ee),"g"),NOT_PATH:new RegExp(e("[^\\%\\/\\:\\@]",ae,ee),"g"),NOT_PATH_NOSCHEME:new RegExp(e("[^\\%\\/\\@]",ae,ee),"g"),NOT_QUERY:new RegExp(e("[^\\%]",ae,ee,"[\\:\\@\\/\\?]",ce),"g"),NOT_FRAGMENT:new RegExp(e("[^\\%]",ae,ee,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(e("[^]",ae,ee),"g"),UNRESERVED:new RegExp(ae,"g"),OTHER_CHARS:new RegExp(e("[^\\%]",ae,ue),"g"),PCT_ENCODED:new RegExp(ne,"g"),IPV4ADDRESS:new RegExp("^("+Fe+")$"),IPV6ADDRESS:new RegExp("^\\[?("+or+")"+t(t("\\%25|\\%(?!"+N+"{2})")+"("+Kr+")")+"?\\]?$")}}var f=i(!1),d=i(!0),h=(function(){function p(u,g){var S=[],b=!0,N=!1,Z=void 0;try{for(var re=u[Symbol.iterator](),ne;!(b=(ne=re.next()).done)&&(S.push(ne.value),!(g&&S.length===g));b=!0);}catch(ye){N=!0,Z=ye}finally{try{!b&&re.return&&re.return()}finally{if(N)throw Z}}return S}return function(u,g){if(Array.isArray(u))return u;if(Symbol.iterator in Object(u))return p(u,g);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),m=function(p){if(Array.isArray(p)){for(var u=0,g=Array(p.length);u<p.length;u++)g[u]=p[u];return g}else return Array.from(p)},E=2147483647,c=36,y=1,_=26,v=38,P=700,T=72,x=128,R="-",I=/^xn--/,$=/[^\0-\x7E]/,V=/[\x2E\u3002\uFF0E\uFF61]/g,M={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=c-y,q=Math.floor,F=String.fromCharCode;function j(p){throw new RangeError(M[p])}function O(p,u){for(var g=[],S=p.length;S--;)g[S]=u(p[S]);return g}function C(p,u){var g=p.split("@"),S="";g.length>1&&(S=g[0]+"@",p=g[1]),p=p.replace(V,".");var b=p.split("."),N=O(b,u).join(".");return S+N}function L(p){for(var u=[],g=0,S=p.length;g<S;){var b=p.charCodeAt(g++);if(b>=55296&&b<=56319&&g<S){var N=p.charCodeAt(g++);(N&64512)==56320?u.push(((b&1023)<<10)+(N&1023)+65536):(u.push(b),g--)}else u.push(b)}return u}var ie=function(u){return String.fromCodePoint.apply(String,m(u))},J=function(u){return u-48<10?u-22:u-65<26?u-65:u-97<26?u-97:c},X=function(u,g){return u+22+75*(u<26)-((g!=0)<<5)},G=function(u,g,S){var b=0;for(u=S?q(u/P):u>>1,u+=q(u/g);u>A*_>>1;b+=c)u=q(u/A);return q(b+(A+1)*u/(u+v))},H=function(u){var g=[],S=u.length,b=0,N=x,Z=T,re=u.lastIndexOf(R);re<0&&(re=0);for(var ne=0;ne<re;++ne)u.charCodeAt(ne)>=128&&j("not-basic"),g.push(u.charCodeAt(ne));for(var ye=re>0?re+1:0;ye<S;){for(var ee=b,ue=1,_e=c;;_e+=c){ye>=S&&j("invalid-input");var ce=J(u.charCodeAt(ye++));(ce>=c||ce>q((E-b)/ue))&&j("overflow"),b+=ce*ue;var ae=_e<=Z?y:_e>=Z+_?_:_e-Z;if(ce<ae)break;var de=c-ae;ue>q(E/de)&&j("overflow"),ue*=de}var oe=g.length+1;Z=G(b-ee,oe,ee==0),q(b/oe)>E-N&&j("overflow"),N+=q(b/oe),b%=oe,g.splice(b++,0,N)}return String.fromCodePoint.apply(String,g)},fe=function(u){var g=[];u=L(u);var S=u.length,b=x,N=0,Z=T,re=!0,ne=!1,ye=void 0;try{for(var ee=u[Symbol.iterator](),ue;!(re=(ue=ee.next()).done);re=!0){var _e=ue.value;_e<128&&g.push(F(_e))}}catch(Tr){ne=!0,ye=Tr}finally{try{!re&&ee.return&&ee.return()}finally{if(ne)throw ye}}var ce=g.length,ae=ce;for(ce&&g.push(R);ae<S;){var de=E,oe=!0,wr=!1,Ne=void 0;try{for(var Fe=u[Symbol.iterator](),le;!(oe=(le=Fe.next()).done);oe=!0){var je=le.value;je>=b&&je<de&&(de=je)}}catch(Tr){wr=!0,Ne=Tr}finally{try{!oe&&Fe.return&&Fe.return()}finally{if(wr)throw Ne}}var Me=ae+1;de-b>q((E-N)/Me)&&j("overflow"),N+=(de-b)*Me,b=de;var Ye=!0,Rr=!1,ir=void 0;try{for(var dt=u[Symbol.iterator](),Tt;!(Ye=(Tt=dt.next()).done);Ye=!0){var Ot=Tt.value;if(Ot<b&&++N>E&&j("overflow"),Ot==b){for(var Qr=N,Zr=c;;Zr+=c){var or=Zr<=Z?y:Zr>=Z+_?_:Zr-Z;if(Qr<or)break;var Kr=Qr-or,ga=c-or;g.push(F(X(or+Kr%ga,0))),Qr=q(Kr/ga)}g.push(F(X(Qr,0))),Z=G(N,Me,ae==ce),N=0,++ae}}}catch(Tr){Rr=!0,ir=Tr}finally{try{!Ye&&dt.return&&dt.return()}finally{if(Rr)throw ir}}++N,++b}return g.join("")},Pe=function(u){return C(u,function(g){return I.test(g)?H(g.slice(4).toLowerCase()):g})},Re=function(u){return C(u,function(g){return $.test(g)?"xn--"+fe(g):g})},te={version:"2.1.0",ucs2:{decode:L,encode:ie},decode:H,encode:fe,toASCII:Re,toUnicode:Pe},ve={};function Ee(p){var u=p.charCodeAt(0),g=void 0;return u<16?g="%0"+u.toString(16).toUpperCase():u<128?g="%"+u.toString(16).toUpperCase():u<2048?g="%"+(u>>6|192).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase():g="%"+(u>>12|224).toString(16).toUpperCase()+"%"+(u>>6&63|128).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase(),g}function Te(p){for(var u="",g=0,S=p.length;g<S;){var b=parseInt(p.substr(g+1,2),16);if(b<128)u+=String.fromCharCode(b),g+=3;else if(b>=194&&b<224){if(S-g>=6){var N=parseInt(p.substr(g+4,2),16);u+=String.fromCharCode((b&31)<<6|N&63)}else u+=p.substr(g,6);g+=6}else if(b>=224){if(S-g>=9){var Z=parseInt(p.substr(g+4,2),16),re=parseInt(p.substr(g+7,2),16);u+=String.fromCharCode((b&15)<<12|(Z&63)<<6|re&63)}else u+=p.substr(g,9);g+=9}else u+=p.substr(g,3),g+=3}return u}function hr(p,u){function g(S){var b=Te(S);return b.match(u.UNRESERVED)?b:S}return p.scheme&&(p.scheme=String(p.scheme).replace(u.PCT_ENCODED,g).toLowerCase().replace(u.NOT_SCHEME,"")),p.userinfo!==void 0&&(p.userinfo=String(p.userinfo).replace(u.PCT_ENCODED,g).replace(u.NOT_USERINFO,Ee).replace(u.PCT_ENCODED,r)),p.host!==void 0&&(p.host=String(p.host).replace(u.PCT_ENCODED,g).toLowerCase().replace(u.NOT_HOST,Ee).replace(u.PCT_ENCODED,r)),p.path!==void 0&&(p.path=String(p.path).replace(u.PCT_ENCODED,g).replace(p.scheme?u.NOT_PATH:u.NOT_PATH_NOSCHEME,Ee).replace(u.PCT_ENCODED,r)),p.query!==void 0&&(p.query=String(p.query).replace(u.PCT_ENCODED,g).replace(u.NOT_QUERY,Ee).replace(u.PCT_ENCODED,r)),p.fragment!==void 0&&(p.fragment=String(p.fragment).replace(u.PCT_ENCODED,g).replace(u.NOT_FRAGMENT,Ee).replace(u.PCT_ENCODED,r)),p}function sr(p){return p.replace(/^0*(.*)/,"$1")||"0"}function ge(p,u){var g=p.match(u.IPV4ADDRESS)||[],S=h(g,2),b=S[1];return b?b.split(".").map(sr).join("."):p}function he(p,u){var g=p.match(u.IPV6ADDRESS)||[],S=h(g,3),b=S[1],N=S[2];if(b){for(var Z=b.toLowerCase().split("::").reverse(),re=h(Z,2),ne=re[0],ye=re[1],ee=ye?ye.split(":").map(sr):[],ue=ne.split(":").map(sr),_e=u.IPV4ADDRESS.test(ue[ue.length-1]),ce=_e?7:8,ae=ue.length-ce,de=Array(ce),oe=0;oe<ce;++oe)de[oe]=ee[oe]||ue[ae+oe]||"";_e&&(de[ce-1]=ge(de[ce-1],u));var wr=de.reduce(function(Me,Ye,Rr){if(!Ye||Ye==="0"){var ir=Me[Me.length-1];ir&&ir.index+ir.length===Rr?ir.length++:Me.push({index:Rr,length:1})}return Me},[]),Ne=wr.sort(function(Me,Ye){return Ye.length-Me.length})[0],Fe=void 0;if(Ne&&Ne.length>1){var le=de.slice(0,Ne.index),je=de.slice(Ne.index+Ne.length);Fe=le.join(":")+"::"+je.join(":")}else Fe=de.join(":");return N&&(Fe+="%"+N),Fe}else return p}var br=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,xe="".match(/(){0}/)[1]===void 0;function se(p){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g={},S=u.iri!==!1?d:f;u.reference==="suffix"&&(p=(u.scheme?u.scheme+":":"")+"//"+p);var b=p.match(br);if(b){xe?(g.scheme=b[1],g.userinfo=b[3],g.host=b[4],g.port=parseInt(b[5],10),g.path=b[6]||"",g.query=b[7],g.fragment=b[8],isNaN(g.port)&&(g.port=b[5])):(g.scheme=b[1]||void 0,g.userinfo=p.indexOf("@")!==-1?b[3]:void 0,g.host=p.indexOf("//")!==-1?b[4]:void 0,g.port=parseInt(b[5],10),g.path=b[6]||"",g.query=p.indexOf("?")!==-1?b[7]:void 0,g.fragment=p.indexOf("#")!==-1?b[8]:void 0,isNaN(g.port)&&(g.port=p.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?b[4]:void 0)),g.host&&(g.host=he(ge(g.host,S),S)),g.scheme===void 0&&g.userinfo===void 0&&g.host===void 0&&g.port===void 0&&!g.path&&g.query===void 0?g.reference="same-document":g.scheme===void 0?g.reference="relative":g.fragment===void 0?g.reference="absolute":g.reference="uri",u.reference&&u.reference!=="suffix"&&u.reference!==g.reference&&(g.error=g.error||"URI is not a "+u.reference+" reference.");var N=ve[(u.scheme||g.scheme||"").toLowerCase()];if(!u.unicodeSupport&&(!N||!N.unicodeSupport)){if(g.host&&(u.domainHost||N&&N.domainHost))try{g.host=te.toASCII(g.host.replace(S.PCT_ENCODED,Te).toLowerCase())}catch(Z){g.error=g.error||"Host's domain name can not be converted to ASCII via punycode: "+Z}hr(g,f)}else hr(g,S);N&&N.parse&&N.parse(g,u)}else g.error=g.error||"URI can not be parsed.";return g}function pr(p,u){var g=u.iri!==!1?d:f,S=[];return p.userinfo!==void 0&&(S.push(p.userinfo),S.push("@")),p.host!==void 0&&S.push(he(ge(String(p.host),g),g).replace(g.IPV6ADDRESS,function(b,N,Z){return"["+N+(Z?"%25"+Z:"")+"]"})),(typeof p.port=="number"||typeof p.port=="string")&&(S.push(":"),S.push(String(p.port))),S.length?S.join(""):void 0}var nr=/^\.\.?\//,Pr=/^\/\.(\/|$)/,xr=/^\/\.\.(\/|$)/,Se=/^\/?(?:.|\n)*?(?=\/|$)/;function Le(p){for(var u=[];p.length;)if(p.match(nr))p=p.replace(nr,"");else if(p.match(Pr))p=p.replace(Pr,"/");else if(p.match(xr))p=p.replace(xr,"/"),u.pop();else if(p==="."||p==="..")p="";else{var g=p.match(Se);if(g){var S=g[0];p=p.slice(S.length),u.push(S)}else throw new Error("Unexpected dot segment condition")}return u.join("")}function $e(p){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=u.iri?d:f,S=[],b=ve[(u.scheme||p.scheme||"").toLowerCase()];if(b&&b.serialize&&b.serialize(p,u),p.host&&!g.IPV6ADDRESS.test(p.host)){if(u.domainHost||b&&b.domainHost)try{p.host=u.iri?te.toUnicode(p.host):te.toASCII(p.host.replace(g.PCT_ENCODED,Te).toLowerCase())}catch(re){p.error=p.error||"Host's domain name can not be converted to "+(u.iri?"Unicode":"ASCII")+" via punycode: "+re}}hr(p,g),u.reference!=="suffix"&&p.scheme&&(S.push(p.scheme),S.push(":"));var N=pr(p,u);if(N!==void 0&&(u.reference!=="suffix"&&S.push("//"),S.push(N),p.path&&p.path.charAt(0)!=="/"&&S.push("/")),p.path!==void 0){var Z=p.path;!u.absolutePath&&(!b||!b.absolutePath)&&(Z=Le(Z)),N===void 0&&(Z=Z.replace(/^\/\//,"/%2F")),S.push(Z)}return p.query!==void 0&&(S.push("?"),S.push(p.query)),p.fragment!==void 0&&(S.push("#"),S.push(p.fragment)),S.join("")}function Oe(p,u){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},S=arguments[3],b={};return S||(p=se($e(p,g),g),u=se($e(u,g),g)),g=g||{},!g.tolerant&&u.scheme?(b.scheme=u.scheme,b.userinfo=u.userinfo,b.host=u.host,b.port=u.port,b.path=Le(u.path||""),b.query=u.query):(u.userinfo!==void 0||u.host!==void 0||u.port!==void 0?(b.userinfo=u.userinfo,b.host=u.host,b.port=u.port,b.path=Le(u.path||""),b.query=u.query):(u.path?(u.path.charAt(0)==="/"?b.path=Le(u.path):((p.userinfo!==void 0||p.host!==void 0||p.port!==void 0)&&!p.path?b.path="/"+u.path:p.path?b.path=p.path.slice(0,p.path.lastIndexOf("/")+1)+u.path:b.path=u.path,b.path=Le(b.path)),b.query=u.query):(b.path=p.path,u.query!==void 0?b.query=u.query:b.query=p.query),b.userinfo=p.userinfo,b.host=p.host,b.port=p.port),b.scheme=p.scheme),b.fragment=u.fragment,b}function Ge(p,u,g){var S=l({scheme:"null"},g);return $e(Oe(se(p,S),se(u,S),S,!0),S)}function ke(p,u){return typeof p=="string"?p=$e(se(p,u),u):s(p)==="object"&&(p=se($e(p,u),u)),p}function Rt(p,u,g){return typeof p=="string"?p=$e(se(p,g),g):s(p)==="object"&&(p=$e(p,g)),typeof u=="string"?u=$e(se(u,g),g):s(u)==="object"&&(u=$e(u,g)),p===u}function ma(p,u){return p&&p.toString().replace(!u||!u.iri?f.ESCAPE:d.ESCAPE,Ee)}function Be(p,u){return p&&p.toString().replace(!u||!u.iri?f.PCT_ENCODED:d.PCT_ENCODED,Te)}var ct={scheme:"http",domainHost:!0,parse:function(u,g){return u.host||(u.error=u.error||"HTTP URIs must have a host."),u},serialize:function(u,g){var S=String(u.scheme).toLowerCase()==="https";return(u.port===(S?443:80)||u.port==="")&&(u.port=void 0),u.path||(u.path="/"),u}},vs={scheme:"https",domainHost:ct.domainHost,parse:ct.parse,serialize:ct.serialize};function gs(p){return typeof p.secure=="boolean"?p.secure:String(p.scheme).toLowerCase()==="wss"}var ut={scheme:"ws",domainHost:!0,parse:function(u,g){var S=u;return S.secure=gs(S),S.resourceName=(S.path||"/")+(S.query?"?"+S.query:""),S.path=void 0,S.query=void 0,S},serialize:function(u,g){if((u.port===(gs(u)?443:80)||u.port==="")&&(u.port=void 0),typeof u.secure=="boolean"&&(u.scheme=u.secure?"wss":"ws",u.secure=void 0),u.resourceName){var S=u.resourceName.split("?"),b=h(S,2),N=b[0],Z=b[1];u.path=N&&N!=="/"?N:void 0,u.query=Z,u.resourceName=void 0}return u.fragment=void 0,u}},ys={scheme:"wss",domainHost:ut.domainHost,parse:ut.parse,serialize:ut.serialize},bo={},Po=!0,_s="[A-Za-z0-9\\-\\.\\_\\~"+(Po?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",Je="[0-9A-Fa-f]",xo=t(t("%[EFef]"+Je+"%"+Je+Je+"%"+Je+Je)+"|"+t("%[89A-Fa-f]"+Je+"%"+Je+Je)+"|"+t("%"+Je+Je)),wo="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Ro="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",To=e(Ro,'[\\"\\\\]'),Oo="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Io=new RegExp(_s,"g"),Br=new RegExp(xo,"g"),$o=new RegExp(e("[^]",wo,"[\\.]",'[\\"]',To),"g"),Es=new RegExp(e("[^]",_s,Oo),"g"),Ao=Es;function va(p){var u=Te(p);return u.match(Io)?u:p}var Ss={scheme:"mailto",parse:function(u,g){var S=u,b=S.to=S.path?S.path.split(","):[];if(S.path=void 0,S.query){for(var N=!1,Z={},re=S.query.split("&"),ne=0,ye=re.length;ne<ye;++ne){var ee=re[ne].split("=");switch(ee[0]){case"to":for(var ue=ee[1].split(","),_e=0,ce=ue.length;_e<ce;++_e)b.push(ue[_e]);break;case"subject":S.subject=Be(ee[1],g);break;case"body":S.body=Be(ee[1],g);break;default:N=!0,Z[Be(ee[0],g)]=Be(ee[1],g);break}}N&&(S.headers=Z)}S.query=void 0;for(var ae=0,de=b.length;ae<de;++ae){var oe=b[ae].split("@");if(oe[0]=Be(oe[0]),g.unicodeSupport)oe[1]=Be(oe[1],g).toLowerCase();else try{oe[1]=te.toASCII(Be(oe[1],g).toLowerCase())}catch(wr){S.error=S.error||"Email address's domain name can not be converted to ASCII via punycode: "+wr}b[ae]=oe.join("@")}return S},serialize:function(u,g){var S=u,b=n(u.to);if(b){for(var N=0,Z=b.length;N<Z;++N){var re=String(b[N]),ne=re.lastIndexOf("@"),ye=re.slice(0,ne).replace(Br,va).replace(Br,r).replace($o,Ee),ee=re.slice(ne+1);try{ee=g.iri?te.toUnicode(ee):te.toASCII(Be(ee,g).toLowerCase())}catch(ae){S.error=S.error||"Email address's domain name can not be converted to "+(g.iri?"Unicode":"ASCII")+" via punycode: "+ae}b[N]=ye+"@"+ee}S.path=b.join(",")}var ue=u.headers=u.headers||{};u.subject&&(ue.subject=u.subject),u.body&&(ue.body=u.body);var _e=[];for(var ce in ue)ue[ce]!==bo[ce]&&_e.push(ce.replace(Br,va).replace(Br,r).replace(Es,Ee)+"="+ue[ce].replace(Br,va).replace(Br,r).replace(Ao,Ee));return _e.length&&(S.query=_e.join("&")),S}},Co=/^([^\:]+)\:(.*)/,bs={scheme:"urn",parse:function(u,g){var S=u.path&&u.path.match(Co),b=u;if(S){var N=g.scheme||b.scheme||"urn",Z=S[1].toLowerCase(),re=S[2],ne=N+":"+(g.nid||Z),ye=ve[ne];b.nid=Z,b.nss=re,b.path=void 0,ye&&(b=ye.parse(b,g))}else b.error=b.error||"URN can not be parsed.";return b},serialize:function(u,g){var S=g.scheme||u.scheme||"urn",b=u.nid,N=S+":"+(g.nid||b),Z=ve[N];Z&&(u=Z.serialize(u,g));var re=u,ne=u.nss;return re.path=(b||g.nid)+":"+ne,re}},Do=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Ps={scheme:"urn:uuid",parse:function(u,g){var S=u;return S.uuid=S.nss,S.nss=void 0,!g.tolerant&&(!S.uuid||!S.uuid.match(Do))&&(S.error=S.error||"UUID is not valid."),S},serialize:function(u,g){var S=u;return S.nss=(u.uuid||"").toLowerCase(),S}};ve[ct.scheme]=ct,ve[vs.scheme]=vs,ve[ut.scheme]=ut,ve[ys.scheme]=ys,ve[Ss.scheme]=Ss,ve[bs.scheme]=bs,ve[Ps.scheme]=Ps,a.SCHEMES=ve,a.pctEncChar=Ee,a.pctDecChars=Te,a.parse=se,a.removeDotSegments=Le,a.serialize=$e,a.resolveComponents=Oe,a.resolve=Ge,a.normalize=ke,a.equal=Rt,a.escapeComponent=ma,a.unescapeComponent=Be,Object.defineProperty(a,"__esModule",{value:!0})}))});var Wt=B((Nf,on)=>{"use strict";on.exports=function a(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var s,r,n;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(r=s;r--!==0;)if(!a(e[r],t[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(n=Object.keys(e),s=n.length,s!==Object.keys(t).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[r]))return!1;for(r=s;r--!==0;){var l=n[r];if(!a(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}});var cn=B((jf,ln)=>{"use strict";ln.exports=function(e){for(var t=0,s=e.length,r=0,n;r<s;)t++,n=e.charCodeAt(r++),n>=55296&&n<=56319&&r<s&&(n=e.charCodeAt(r),(n&64512)==56320&&r++);return t}});var zr=B((Lf,fn)=>{"use strict";fn.exports={copy:eu,checkDataType:Fa,checkDataTypes:ru,coerceToTypes:tu,toHash:qa,getProperty:Ua,escapeQuotes:Va,equal:Wt(),ucs2length:cn(),varOccurences:nu,varReplace:iu,schemaHasRules:ou,schemaHasRulesExcept:lu,schemaUnknownRules:cu,toQuotedString:Ma,getPathExpr:uu,getPath:du,getData:pu,unescapeFragment:mu,unescapeJsonPointer:za,escapeFragment:vu,escapeJsonPointer:Ha};function eu(a,e){e=e||{};for(var t in a)e[t]=a[t];return e}function Fa(a,e,t,s){var r=s?" !== ":" === ",n=s?" || ":" && ",l=s?"!":"",i=s?"":"!";switch(a){case"null":return e+r+"null";case"array":return l+"Array.isArray("+e+")";case"object":return"("+l+e+n+"typeof "+e+r+'"object"'+n+i+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+r+'"number"'+n+i+"("+e+" % 1)"+n+e+r+e+(t?n+l+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+r+'"'+a+'"'+(t?n+l+"isFinite("+e+")":"")+")";default:return"typeof "+e+r+'"'+a+'"'}}function ru(a,e,t){switch(a.length){case 1:return Fa(a[0],e,t,!0);default:var s="",r=qa(a);r.array&&r.object&&(s=r.null?"(":"(!"+e+" || ",s+="typeof "+e+' !== "object")',delete r.null,delete r.array,delete r.object),r.number&&delete r.integer;for(var n in r)s+=(s?" && ":"")+Fa(n,e,t,!0);return s}}var un=qa(["string","number","integer","boolean","null"]);function tu(a,e){if(Array.isArray(e)){for(var t=[],s=0;s<e.length;s++){var r=e[s];(un[r]||a==="array"&&r==="array")&&(t[t.length]=r)}if(t.length)return t}else{if(un[e])return[e];if(a==="array"&&e==="array")return["array"]}}function qa(a){for(var e={},t=0;t<a.length;t++)e[a[t]]=!0;return e}var au=/^[a-z$_][a-z$_0-9]*$/i,su=/'|\\/g;function Ua(a){return typeof a=="number"?"["+a+"]":au.test(a)?"."+a:"['"+Va(a)+"']"}function Va(a){return a.replace(su,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function nu(a,e){e+="[^0-9]";var t=a.match(new RegExp(e,"g"));return t?t.length:0}function iu(a,e,t){return e+="([^0-9])",t=t.replace(/\$/g,"$$$$"),a.replace(new RegExp(e,"g"),t+"$1")}function ou(a,e){if(typeof a=="boolean")return!a;for(var t in a)if(e[t])return!0}function lu(a,e,t){if(typeof a=="boolean")return!a&&t!="not";for(var s in a)if(s!=t&&e[s])return!0}function cu(a,e){if(typeof a!="boolean"){for(var t in a)if(!e[t])return t}}function Ma(a){return"'"+Va(a)+"'"}function uu(a,e,t,s){var r=t?"'/' + "+e+(s?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):s?"'[' + "+e+" + ']'":"'[\\'' + "+e+" + '\\']'";return dn(a,r)}function du(a,e,t){var s=Ma(t?"/"+Ha(e):Ua(e));return dn(a,s)}var fu=/^\/(?:[^~]|~0|~1)*$/,hu=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function pu(a,e,t){var s,r,n,l;if(a==="")return"rootData";if(a[0]=="/"){if(!fu.test(a))throw new Error("Invalid JSON-pointer: "+a);r=a,n="rootData"}else{if(l=a.match(hu),!l)throw new Error("Invalid JSON-pointer: "+a);if(s=+l[1],r=l[2],r=="#"){if(s>=e)throw new Error("Cannot access property/index "+s+" levels up, current level is "+e);return t[e-s]}if(s>e)throw new Error("Cannot access data "+s+" levels up, current level is "+e);if(n="data"+(e-s||""),!r)return n}for(var i=n,f=r.split("/"),d=0;d<f.length;d++){var h=f[d];h&&(n+=Ua(za(h)),i+=" && "+n)}return i}function dn(a,e){return a=='""'?e:(a+" + "+e).replace(/([^\\])' \+ '/g,"$1")}function mu(a){return za(decodeURIComponent(a))}function vu(a){return encodeURIComponent(Ha(a))}function Ha(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}function za(a){return a.replace(/~1/g,"/").replace(/~0/g,"~")}});var Wa=B((Ff,hn)=>{"use strict";var gu=zr();hn.exports=yu;function yu(a){gu.copy(a,this)}});var mn=B((Mf,pn)=>{"use strict";var _r=pn.exports=function(a,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var s=typeof t=="function"?t:t.pre||function(){},r=t.post||function(){};Bt(e,s,r,a,"",a)};_r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};_r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};_r.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};_r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Bt(a,e,t,s,r,n,l,i,f,d){if(s&&typeof s=="object"&&!Array.isArray(s)){e(s,r,n,l,i,f,d);for(var h in s){var m=s[h];if(Array.isArray(m)){if(h in _r.arrayKeywords)for(var E=0;E<m.length;E++)Bt(a,e,t,m[E],r+"/"+h+"/"+E,n,r,h,s,E)}else if(h in _r.propsKeywords){if(m&&typeof m=="object")for(var c in m)Bt(a,e,t,m[c],r+"/"+h+"/"+_u(c),n,r,h,s,c)}else(h in _r.keywords||a.allKeys&&!(h in _r.skipKeywords))&&Bt(a,e,t,m,r+"/"+h,n,r,h,s)}t(s,r,n,l,i,f,d)}}function _u(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}});var Yt=B((qf,_n)=>{"use strict";var Pt=nn(),vn=Wt(),Gt=zr(),Qt=Wa(),Eu=mn();_n.exports=Sr;Sr.normalizeId=Er;Sr.fullPath=Zt;Sr.url=Kt;Sr.ids=wu;Sr.inlineRef=Ba;Sr.schema=Jt;function Sr(a,e,t){var s=this._refs[t];if(typeof s=="string")if(this._refs[s])s=this._refs[s];else return Sr.call(this,a,e,s);if(s=s||this._schemas[t],s instanceof Qt)return Ba(s.schema,this._opts.inlineRefs)?s.schema:s.validate||this._compile(s);var r=Jt.call(this,e,t),n,l,i;return r&&(n=r.schema,e=r.root,i=r.baseId),n instanceof Qt?l=n.validate||a.call(this,n.schema,e,void 0,i):n!==void 0&&(l=Ba(n,this._opts.inlineRefs)?n:a.call(this,n,e,void 0,i)),l}function Jt(a,e){var t=Pt.parse(e),s=yn(t),r=Zt(this._getId(a.schema));if(Object.keys(a.schema).length===0||s!==r){var n=Er(s),l=this._refs[n];if(typeof l=="string")return Su.call(this,a,l,t);if(l instanceof Qt)l.validate||this._compile(l),a=l;else if(l=this._schemas[n],l instanceof Qt){if(l.validate||this._compile(l),n==Er(e))return{schema:l,root:a,baseId:r};a=l}else return;if(!a.schema)return;r=Zt(this._getId(a.schema))}return gn.call(this,t,r,a.schema,a)}function Su(a,e,t){var s=Jt.call(this,a,e);if(s){var r=s.schema,n=s.baseId;a=s.root;var l=this._getId(r);return l&&(n=Kt(n,l)),gn.call(this,t,n,r,a)}}var bu=Gt.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function gn(a,e,t,s){if(a.fragment=a.fragment||"",a.fragment.slice(0,1)=="/"){for(var r=a.fragment.split("/"),n=1;n<r.length;n++){var l=r[n];if(l){if(l=Gt.unescapeFragment(l),t=t[l],t===void 0)break;var i;if(!bu[l]&&(i=this._getId(t),i&&(e=Kt(e,i)),t.$ref)){var f=Kt(e,t.$ref),d=Jt.call(this,s,f);d&&(t=d.schema,s=d.root,e=d.baseId)}}}if(t!==void 0&&t!==s.schema)return{schema:t,root:s,baseId:e}}}var Pu=Gt.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function Ba(a,e){if(e===!1)return!1;if(e===void 0||e===!0)return Qa(a);if(e)return Za(a)<=e}function Qa(a){var e;if(Array.isArray(a)){for(var t=0;t<a.length;t++)if(e=a[t],typeof e=="object"&&!Qa(e))return!1}else for(var s in a)if(s=="$ref"||(e=a[s],typeof e=="object"&&!Qa(e)))return!1;return!0}function Za(a){var e=0,t;if(Array.isArray(a)){for(var s=0;s<a.length;s++)if(t=a[s],typeof t=="object"&&(e+=Za(t)),e==1/0)return 1/0}else for(var r in a){if(r=="$ref")return 1/0;if(Pu[r])e++;else if(t=a[r],typeof t=="object"&&(e+=Za(t)+1),e==1/0)return 1/0}return e}function Zt(a,e){e!==!1&&(a=Er(a));var t=Pt.parse(a);return yn(t)}function yn(a){return Pt.serialize(a).split("#")[0]+"#"}var xu=/#\/?$/;function Er(a){return a?a.replace(xu,""):""}function Kt(a,e){return e=Er(e),Pt.resolve(a,e)}function wu(a){var e=Er(this._getId(a)),t={"":e},s={"":Zt(e,!1)},r={},n=this;return Eu(a,{allKeys:!0},function(l,i,f,d,h,m,E){if(i!==""){var c=n._getId(l),y=t[d],_=s[d]+"/"+h;if(E!==void 0&&(_+="/"+(typeof E=="number"?E:Gt.escapeFragment(E))),typeof c=="string"){c=y=Er(y?Pt.resolve(y,c):c);var v=n._refs[c];if(typeof v=="string"&&(v=n._refs[v]),v&&v.schema){if(!vn(l,v.schema))throw new Error('id "'+c+'" resolves to more than one schema')}else if(c!=Er(_))if(c[0]=="#"){if(r[c]&&!vn(l,r[c]))throw new Error('id "'+c+'" resolves to more than one schema');r[c]=l}else n._refs[c]=_}t[i]=y,s[i]=_}}),r}});var Xt=B((Uf,Sn)=>{"use strict";var Ka=Yt();Sn.exports={Validation:En(Ru),MissingRef:En(Ga)};function Ru(a){this.message="validation failed",this.errors=a,this.ajv=this.validation=!0}Ga.message=function(a,e){return"can't resolve reference "+e+" from id "+a};function Ga(a,e,t){this.message=t||Ga.message(a,e),this.missingRef=Ka.url(a,e),this.missingSchema=Ka.normalizeId(Ka.fullPath(this.missingRef))}function En(a){return a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a}});var Ja=B((Vf,bn)=>{"use strict";bn.exports=function(a,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var t=typeof e.cycles=="boolean"?e.cycles:!1,s=e.cmp&&(function(n){return function(l){return function(i,f){var d={key:i,value:l[i]},h={key:f,value:l[f]};return n(d,h)}}})(e.cmp),r=[];return(function n(l){if(l&&l.toJSON&&typeof l.toJSON=="function"&&(l=l.toJSON()),l!==void 0){if(typeof l=="number")return isFinite(l)?""+l:"null";if(typeof l!="object")return JSON.stringify(l);var i,f;if(Array.isArray(l)){for(f="[",i=0;i<l.length;i++)i&&(f+=","),f+=n(l[i])||"null";return f+"]"}if(l===null)return"null";if(r.indexOf(l)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var d=r.push(l)-1,h=Object.keys(l).sort(s&&s(l));for(f="",i=0;i<h.length;i++){var m=h[i],E=n(l[m]);E&&(f&&(f+=","),f+=JSON.stringify(m)+":"+E)}return r.splice(d,1),"{"+f+"}"}})(a)}});var Ya=B((Hf,Pn)=>{"use strict";Pn.exports=function(e,t,s){var r="",n=e.schema.$async===!0,l=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),i=e.self._getId(e.schema);if(e.opts.strictKeywords){var f=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(f){var d="unknown keyword: "+f;if(e.opts.strictKeywords==="log")e.logger.warn(d);else throw new Error(d)}}if(e.isTop&&(r+=" var validate = ",n&&(e.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",i&&(e.opts.sourceCode||e.opts.processCode)&&(r+=" "+("/*# sourceURL="+i+" */")+" ")),typeof e.schema=="boolean"||!(l||e.schema.$ref)){var t="false schema",h=e.level,m=e.dataLevel,E=e.schema[t],c=e.schemaPath+e.util.getProperty(t),y=e.errSchemaPath+"/"+t,I=!e.opts.allErrors,M,_="data"+(m||""),R="valid"+h;if(e.schema===!1){e.isTop?I=!0:r+=" var "+R+" = false; ";var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(M||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'boolean schema is false' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+_+" "),r+=" } "):r+=" {} ";var P=r;r=v.pop(),!e.compositeRule&&I?e.async?r+=" throw new ValidationError(["+P+"]); ":r+=" validate.errors = ["+P+"]; return false; ":r+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?n?r+=" return data; ":r+=" validate.errors = null; return true; ":r+=" var "+R+" = true; ";return e.isTop&&(r+=" }; return validate; "),r}if(e.isTop){var T=e.isTop,h=e.level=0,m=e.dataLevel=0,_="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var x="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(x);else throw new Error(x)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{var h=e.level,m=e.dataLevel,_="data"+(m||"");if(i&&(e.baseId=e.resolve.url(e.baseId,i)),n&&!e.async)throw new Error("async schema in sync schema");r+=" var errs_"+h+" = errors;"}var R="valid"+h,I=!e.opts.allErrors,$="",V="",M,A=e.schema.type,q=Array.isArray(A);if(A&&e.opts.nullable&&e.schema.nullable===!0&&(q?A.indexOf("null")==-1&&(A=A.concat("null")):A!="null"&&(A=[A,"null"],q=!0)),q&&A.length==1&&(A=A[0],q=!1),e.schema.$ref&&l){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(l=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(r+=" "+e.RULES.all.$comment.code(e,"$comment")),A){if(e.opts.coerceTypes)var F=e.util.coerceToTypes(e.opts.coerceTypes,A);var j=e.RULES.types[A];if(F||q||j===!0||j&&!Se(j)){var c=e.schemaPath+".type",y=e.errSchemaPath+"/type",c=e.schemaPath+".type",y=e.errSchemaPath+"/type",O=q?"checkDataTypes":"checkDataType";if(r+=" if ("+e.util[O](A,_,e.opts.strictNumbers,!0)+") { ",F){var C="dataType"+h,L="coerced"+h;r+=" var "+C+" = typeof "+_+"; var "+L+" = undefined; ",e.opts.coerceTypes=="array"&&(r+=" if ("+C+" == 'object' && Array.isArray("+_+") && "+_+".length == 1) { "+_+" = "+_+"[0]; "+C+" = typeof "+_+"; if ("+e.util.checkDataType(e.schema.type,_,e.opts.strictNumbers)+") "+L+" = "+_+"; } "),r+=" if ("+L+" !== undefined) ; ";var ie=F;if(ie)for(var J,X=-1,G=ie.length-1;X<G;)J=ie[X+=1],J=="string"?r+=" else if ("+C+" == 'number' || "+C+" == 'boolean') "+L+" = '' + "+_+"; else if ("+_+" === null) "+L+" = ''; ":J=="number"||J=="integer"?(r+=" else if ("+C+" == 'boolean' || "+_+" === null || ("+C+" == 'string' && "+_+" && "+_+" == +"+_+" ",J=="integer"&&(r+=" && !("+_+" % 1)"),r+=")) "+L+" = +"+_+"; "):J=="boolean"?r+=" else if ("+_+" === 'false' || "+_+" === 0 || "+_+" === null) "+L+" = false; else if ("+_+" === 'true' || "+_+" === 1) "+L+" = true; ":J=="null"?r+=" else if ("+_+" === '' || "+_+" === 0 || "+_+" === false) "+L+" = null; ":e.opts.coerceTypes=="array"&&J=="array"&&(r+=" else if ("+C+" == 'string' || "+C+" == 'number' || "+C+" == 'boolean' || "+_+" == null) "+L+" = ["+_+"]; ");r+=" else { ";var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",q?r+=""+A.join(","):r+=""+A,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",q?r+=""+A.join(","):r+=""+A,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+_+" "),r+=" } "):r+=" {} ";var P=r;r=v.pop(),!e.compositeRule&&I?e.async?r+=" throw new ValidationError(["+P+"]); ":r+=" validate.errors = ["+P+"]; return false; ":r+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } if ("+L+" !== undefined) { ";var H=m?"data"+(m-1||""):"parentData",fe=m?e.dataPathArr[m]:"parentDataProperty";r+=" "+_+" = "+L+"; ",m||(r+="if ("+H+" !== undefined)"),r+=" "+H+"["+fe+"] = "+L+"; } "}else{var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",q?r+=""+A.join(","):r+=""+A,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",q?r+=""+A.join(","):r+=""+A,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+_+" "),r+=" } "):r+=" {} ";var P=r;r=v.pop(),!e.compositeRule&&I?e.async?r+=" throw new ValidationError(["+P+"]); ":r+=" validate.errors = ["+P+"]; return false; ":r+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+=" } "}}if(e.schema.$ref&&!l)r+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",I&&(r+=" } if (errors === ",T?r+="0":r+="errs_"+h,r+=") { ",V+="}");else{var Pe=e.RULES;if(Pe){for(var j,Re=-1,te=Pe.length-1;Re<te;)if(j=Pe[Re+=1],Se(j)){if(j.type&&(r+=" if ("+e.util.checkDataType(j.type,_,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(j.type=="object"&&e.schema.properties){var E=e.schema.properties,ve=Object.keys(E),Ee=ve;if(Ee)for(var Te,hr=-1,sr=Ee.length-1;hr<sr;){Te=Ee[hr+=1];var ge=E[Te];if(ge.default!==void 0){var he=_+e.util.getProperty(Te);if(e.compositeRule){if(e.opts.strictDefaults){var x="default is ignored for: "+he;if(e.opts.strictDefaults==="log")e.logger.warn(x);else throw new Error(x)}}else r+=" if ("+he+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+he+" === null || "+he+" === '' "),r+=" ) "+he+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(ge.default)+" ":r+=" "+JSON.stringify(ge.default)+" ",r+="; "}}}else if(j.type=="array"&&Array.isArray(e.schema.items)){var br=e.schema.items;if(br){for(var ge,X=-1,xe=br.length-1;X<xe;)if(ge=br[X+=1],ge.default!==void 0){var he=_+"["+X+"]";if(e.compositeRule){if(e.opts.strictDefaults){var x="default is ignored for: "+he;if(e.opts.strictDefaults==="log")e.logger.warn(x);else throw new Error(x)}}else r+=" if ("+he+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+he+" === null || "+he+" === '' "),r+=" ) "+he+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(ge.default)+" ":r+=" "+JSON.stringify(ge.default)+" ",r+="; "}}}}var se=j.rules;if(se){for(var pr,nr=-1,Pr=se.length-1;nr<Pr;)if(pr=se[nr+=1],Le(pr)){var xr=pr.code(e,pr.keyword,j.type);xr&&(r+=" "+xr+" ",I&&($+="}"))}}if(I&&(r+=" "+$+" ",$=""),j.type&&(r+=" } ",A&&A===j.type&&!F)){r+=" else { ";var c=e.schemaPath+".type",y=e.errSchemaPath+"/type",v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(y)+" , params: { type: '",q?r+=""+A.join(","):r+=""+A,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",q?r+=""+A.join(","):r+=""+A,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+_+" "),r+=" } "):r+=" {} ";var P=r;r=v.pop(),!e.compositeRule&&I?e.async?r+=" throw new ValidationError(["+P+"]); ":r+=" validate.errors = ["+P+"]; return false; ":r+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "}I&&(r+=" if (errors === ",T?r+="0":r+="errs_"+h,r+=") { ",V+="}")}}}I&&(r+=" "+V+" "),T?(n?(r+=" if (errors === 0) return data; ",r+=" else throw new ValidationError(vErrors); "):(r+=" validate.errors = vErrors; ",r+=" return errors === 0; "),r+=" }; return validate;"):r+=" var "+R+" = errors === errs_"+h+";";function Se(Oe){for(var Ge=Oe.rules,ke=0;ke<Ge.length;ke++)if(Le(Ge[ke]))return!0}function Le(Oe){return e.schema[Oe.keyword]!==void 0||Oe.implements&&$e(Oe)}function $e(Oe){for(var Ge=Oe.implements,ke=0;ke<Ge.length;ke++)if(e.schema[Ge[ke]]!==void 0)return!0}return r}});var On=B((zf,Tn)=>{"use strict";var ea=Yt(),ta=zr(),wn=Xt(),Tu=Ja(),xn=Ya(),Ou=ta.ucs2length,Iu=Wt(),$u=wn.Validation;Tn.exports=Xa;function Xa(a,e,t,s){var r=this,n=this._opts,l=[void 0],i={},f=[],d={},h=[],m={},E=[];e=e||{schema:a,refVal:l,refs:i};var c=Au.call(this,a,e,s),y=this._compilations[c.index];if(c.compiling)return y.callValidate=x;var _=this._formats,v=this.RULES;try{var P=R(a,e,t,s);y.validate=P;var T=y.callValidate;return T&&(T.schema=P.schema,T.errors=null,T.refs=P.refs,T.refVal=P.refVal,T.root=P.root,T.$async=P.$async,n.sourceCode&&(T.source=P.source)),P}finally{Cu.call(this,a,e,s)}function x(){var O=y.validate,C=O.apply(this,arguments);return x.errors=O.errors,C}function R(O,C,L,ie){var J=!C||C&&C.schema==O;if(C.schema!=e.schema)return Xa.call(r,O,C,L,ie);var X=O.$async===!0,G=xn({isTop:!0,schema:O,isRoot:J,baseId:ie,root:C,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:wn.MissingRef,RULES:v,validate:xn,util:ta,resolve:ea,resolveRef:I,usePattern:q,useDefault:F,useCustomRule:j,opts:n,formats:_,logger:r.logger,self:r});G=ra(l,Nu)+ra(f,Du)+ra(h,ku)+ra(E,ju)+G,n.processCode&&(G=n.processCode(G,O));var H;try{var fe=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",G);H=fe(r,v,_,e,l,h,E,Iu,Ou,$u),l[0]=H}catch(Pe){throw r.logger.error("Error compiling schema, function code:",G),Pe}return H.schema=O,H.errors=null,H.refs=i,H.refVal=l,H.root=J?H:C,X&&(H.$async=!0),n.sourceCode===!0&&(H.source={code:G,patterns:f,defaults:h}),H}function I(O,C,L){C=ea.url(O,C);var ie=i[C],J,X;if(ie!==void 0)return J=l[ie],X="refVal["+ie+"]",A(J,X);if(!L&&e.refs){var G=e.refs[C];if(G!==void 0)return J=e.refVal[G],X=$(C,J),A(J,X)}X=$(C);var H=ea.call(r,R,e,C);if(H===void 0){var fe=t&&t[C];fe&&(H=ea.inlineRef(fe,n.inlineRefs)?fe:Xa.call(r,fe,e,t,O))}if(H===void 0)V(C);else return M(C,H),A(H,X)}function $(O,C){var L=l.length;return l[L]=C,i[O]=L,"refVal"+L}function V(O){delete i[O]}function M(O,C){var L=i[O];l[L]=C}function A(O,C){return typeof O=="object"||typeof O=="boolean"?{code:C,schema:O,inline:!0}:{code:C,$async:O&&!!O.$async}}function q(O){var C=d[O];return C===void 0&&(C=d[O]=f.length,f[C]=O),"pattern"+C}function F(O){switch(typeof O){case"boolean":case"number":return""+O;case"string":return ta.toQuotedString(O);case"object":if(O===null)return"null";var C=Tu(O),L=m[C];return L===void 0&&(L=m[C]=h.length,h[L]=O),"default"+L}}function j(O,C,L,ie){if(r._opts.validateSchema!==!1){var J=O.definition.dependencies;if(J&&!J.every(function(Ee){return Object.prototype.hasOwnProperty.call(L,Ee)}))throw new Error("parent schema must have all required keywords: "+J.join(","));var X=O.definition.validateSchema;if(X){var G=X(C);if(!G){var H="keyword schema is invalid: "+r.errorsText(X.errors);if(r._opts.validateSchema=="log")r.logger.error(H);else throw new Error(H)}}}var fe=O.definition.compile,Pe=O.definition.inline,Re=O.definition.macro,te;if(fe)te=fe.call(r,C,L,ie);else if(Re)te=Re.call(r,C,L,ie),n.validateSchema!==!1&&r.validateSchema(te,!0);else if(Pe)te=Pe.call(r,ie,O.keyword,C,L);else if(te=O.definition.validate,!te)return;if(te===void 0)throw new Error('custom keyword "'+O.keyword+'"failed to compile');var ve=E.length;return E[ve]=te,{code:"customRule"+ve,validate:te}}}function Au(a,e,t){var s=Rn.call(this,a,e,t);return s>=0?{index:s,compiling:!0}:(s=this._compilations.length,this._compilations[s]={schema:a,root:e,baseId:t},{index:s,compiling:!1})}function Cu(a,e,t){var s=Rn.call(this,a,e,t);s>=0&&this._compilations.splice(s,1)}function Rn(a,e,t){for(var s=0;s<this._compilations.length;s++){var r=this._compilations[s];if(r.schema==a&&r.root==e&&r.baseId==t)return s}return-1}function Du(a,e){return"var pattern"+a+" = new RegExp("+ta.toQuotedString(e[a])+");"}function ku(a){return"var default"+a+" = defaults["+a+"];"}function Nu(a,e){return e[a]===void 0?"":"var refVal"+a+" = refVal["+a+"];"}function ju(a){return"var customRule"+a+" = customRules["+a+"];"}function ra(a,e){if(!a.length)return"";for(var t="",s=0;s<a.length;s++)t+=e(s,a);return t}});var $n=B((Wf,In)=>{"use strict";var aa=In.exports=function(){this._cache={}};aa.prototype.put=function(e,t){this._cache[e]=t};aa.prototype.get=function(e){return this._cache[e]};aa.prototype.del=function(e){delete this._cache[e]};aa.prototype.clear=function(){this._cache={}}});var Vn=B((Bf,Un)=>{"use strict";var Lu=zr(),Fu=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Mu=[0,31,28,31,30,31,30,31,31,30,31,30,31],qu=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,An=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,Uu=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Vu=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Cn=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Dn=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,kn=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Nn=/^(?:\/(?:[^~/]|~0|~1)*)*$/,jn=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Ln=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;Un.exports=sa;function sa(a){return a=a=="full"?"full":"fast",Lu.copy(sa[a])}sa.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":Cn,url:Dn,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:An,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:qn,uuid:kn,"json-pointer":Nn,"json-pointer-uri-fragment":jn,"relative-json-pointer":Ln};sa.full={date:Fn,time:Mn,"date-time":Wu,uri:Qu,"uri-reference":Vu,"uri-template":Cn,url:Dn,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:An,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:qn,uuid:kn,"json-pointer":Nn,"json-pointer-uri-fragment":jn,"relative-json-pointer":Ln};function Hu(a){return a%4===0&&(a%100!==0||a%400===0)}function Fn(a){var e=a.match(Fu);if(!e)return!1;var t=+e[1],s=+e[2],r=+e[3];return s>=1&&s<=12&&r>=1&&r<=(s==2&&Hu(t)?29:Mu[s])}function Mn(a,e){var t=a.match(qu);if(!t)return!1;var s=t[1],r=t[2],n=t[3],l=t[5];return(s<=23&&r<=59&&n<=59||s==23&&r==59&&n==60)&&(!e||l)}var zu=/t|\s/i;function Wu(a){var e=a.split(zu);return e.length==2&&Fn(e[0])&&Mn(e[1],!0)}var Bu=/\/|:/;function Qu(a){return Bu.test(a)&&Uu.test(a)}var Zu=/[^\\]\\Z/;function qn(a){if(Zu.test(a))return!1;try{return new RegExp(a),!0}catch{return!1}}});var zn=B((Qf,Hn)=>{"use strict";Hn.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,h="data"+(l||""),m="valid"+n,E,c;if(i=="#"||i=="#/")e.isRoot?(E=e.async,c="validate"):(E=e.root.schema.$async===!0,c="root.refVal[0]");else{var y=e.resolveRef(e.baseId,i,e.isRoot);if(y===void 0){var _=e.MissingRefError.message(e.baseId,i);if(e.opts.missingRefs=="fail"){e.logger.error(_);var v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { ref: '"+e.util.escapeQuotes(i)+"' } ",e.opts.messages!==!1&&(r+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(i)+"' "),e.opts.verbose&&(r+=" , schema: "+e.util.toQuotedString(i)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),r+=" } "):r+=" {} ";var P=r;r=v.pop(),!e.compositeRule&&d?e.async?r+=" throw new ValidationError(["+P+"]); ":r+=" validate.errors = ["+P+"]; return false; ":r+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d&&(r+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(_),d&&(r+=" if (true) { ");else throw new e.MissingRefError(e.baseId,i,_)}else if(y.inline){var T=e.util.copy(e);T.level++;var x="valid"+T.level;T.schema=y.schema,T.schemaPath="",T.errSchemaPath=i;var R=e.validate(T).replace(/validate\.schema/g,y.code);r+=" "+R+" ",d&&(r+=" if ("+x+") { ")}else E=y.$async===!0||e.async&&y.$async!==!1,c=y.code}if(c){var v=v||[];v.push(r),r="",e.opts.passContext?r+=" "+c+".call(this, ":r+=" "+c+"( ",r+=" "+h+", (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var I=l?"data"+(l-1||""):"parentData",$=l?e.dataPathArr[l]:"parentDataProperty";r+=" , "+I+" , "+$+", rootData) ";var V=r;if(r=v.pop(),E){if(!e.async)throw new Error("async schema referenced by sync schema");d&&(r+=" var "+m+"; "),r+=" try { await "+V+"; ",d&&(r+=" "+m+" = true; "),r+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",d&&(r+=" "+m+" = false; "),r+=" } ",d&&(r+=" if ("+m+") { ")}else r+=" if (!"+V+") { if (vErrors === null) vErrors = "+c+".errors; else vErrors = vErrors.concat("+c+".errors); errors = vErrors.length; } ",d&&(r+=" else { ")}return r}});var Bn=B((Zf,Wn)=>{"use strict";Wn.exports=function(e,t,s){var r=" ",n=e.schema[t],l=e.schemaPath+e.util.getProperty(t),i=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,d=e.util.copy(e),h="";d.level++;var m="valid"+d.level,E=d.baseId,c=!0,y=n;if(y)for(var _,v=-1,P=y.length-1;v<P;)_=y[v+=1],(e.opts.strictKeywords?typeof _=="object"&&Object.keys(_).length>0||_===!1:e.util.schemaHasRules(_,e.RULES.all))&&(c=!1,d.schema=_,d.schemaPath=l+"["+v+"]",d.errSchemaPath=i+"/"+v,r+=" "+e.validate(d)+" ",d.baseId=E,f&&(r+=" if ("+m+") { ",h+="}"));return f&&(c?r+=" if (true) { ":r+=" "+h.slice(0,-1)+" "),r}});var Zn=B((Kf,Qn)=>{"use strict";Qn.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E="valid"+n,c="errs__"+n,y=e.util.copy(e),_="";y.level++;var v="valid"+y.level,P=i.every(function(M){return e.opts.strictKeywords?typeof M=="object"&&Object.keys(M).length>0||M===!1:e.util.schemaHasRules(M,e.RULES.all)});if(P){var T=y.baseId;r+=" var "+c+" = errors; var "+E+" = false; ";var x=e.compositeRule;e.compositeRule=y.compositeRule=!0;var R=i;if(R)for(var I,$=-1,V=R.length-1;$<V;)I=R[$+=1],y.schema=I,y.schemaPath=f+"["+$+"]",y.errSchemaPath=d+"/"+$,r+=" "+e.validate(y)+" ",y.baseId=T,r+=" "+E+" = "+E+" || "+v+"; if (!"+E+") { ",_+="}";e.compositeRule=y.compositeRule=x,r+=" "+_+" if (!"+E+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } else { errors = "+c+"; if (vErrors !== null) { if ("+c+") vErrors.length = "+c+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else h&&(r+=" if (true) { ");return r}});var Gn=B((Gf,Kn)=>{"use strict";Kn.exports=function(e,t,s){var r=" ",n=e.schema[t],l=e.errSchemaPath+"/"+t,i=!e.opts.allErrors,f=e.util.toQuotedString(n);return e.opts.$comment===!0?r+=" console.log("+f+");":typeof e.opts.$comment=="function"&&(r+=" self._opts.$comment("+f+", "+e.util.toQuotedString(l)+", validate.root.schema);"),r}});var Yn=B((Jf,Jn)=>{"use strict";Jn.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E="valid"+n,c=e.opts.$data&&i&&i.$data,y;c?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",y="schema"+n):y=i,c||(r+=" var schema"+n+" = validate.schema"+f+";"),r+="var "+E+" = equal("+m+", schema"+n+"); if (!"+E+") { ";var _=_||[];_.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { allowedValue: schema"+n+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be equal to constant' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var v=r;return r=_.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+v+"]); ":r+=" validate.errors = ["+v+"]; return false; ":r+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",h&&(r+=" else { "),r}});var ei=B((Yf,Xn)=>{"use strict";Xn.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E="valid"+n,c="errs__"+n,y=e.util.copy(e),_="";y.level++;var v="valid"+y.level,P="i"+n,T=y.dataLevel=e.dataLevel+1,x="data"+T,R=e.baseId,I=e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===!1:e.util.schemaHasRules(i,e.RULES.all);if(r+="var "+c+" = errors;var "+E+";",I){var $=e.compositeRule;e.compositeRule=y.compositeRule=!0,y.schema=i,y.schemaPath=f,y.errSchemaPath=d,r+=" var "+v+" = false; for (var "+P+" = 0; "+P+" < "+m+".length; "+P+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,P,e.opts.jsonPointers,!0);var V=m+"["+P+"]";y.dataPathArr[T]=P;var M=e.validate(y);y.baseId=R,e.util.varOccurences(M,x)<2?r+=" "+e.util.varReplace(M,x,V)+" ":r+=" var "+x+" = "+V+"; "+M+" ",r+=" if ("+v+") break; } ",e.compositeRule=y.compositeRule=$,r+=" "+_+" if (!"+v+") {"}else r+=" if ("+m+".length == 0) {";var A=A||[];A.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should contain a valid item' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var q=r;return r=A.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+q+"]); ":r+=" validate.errors = ["+q+"]; return false; ":r+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ",I&&(r+=" errors = "+c+"; if (vErrors !== null) { if ("+c+") vErrors.length = "+c+"; else vErrors = null; } "),e.opts.allErrors&&(r+=" } "),r}});var ti=B((Xf,ri)=>{"use strict";ri.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E="errs__"+n,c=e.util.copy(e),y="";c.level++;var _="valid"+c.level,v={},P={},T=e.opts.ownProperties;for($ in i)if($!="__proto__"){var x=i[$],R=Array.isArray(x)?P:v;R[$]=x}r+="var "+E+" = errors;";var I=e.errorPath;r+="var missing"+n+";";for(var $ in P)if(R=P[$],R.length){if(r+=" if ( "+m+e.util.getProperty($)+" !== undefined ",T&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes($)+"') "),h){r+=" && ( ";var V=R;if(V)for(var M,A=-1,q=V.length-1;A<q;){M=V[A+=1],A&&(r+=" || ");var F=e.util.getProperty(M),j=m+F;r+=" ( ( "+j+" === undefined ",T&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(M)+"') "),r+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?M:F)+") ) "}r+=")) { ";var O="missing"+n,C="' + "+O+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(I,O,!0):I+" + "+O);var L=L||[];L.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { property: '"+e.util.escapeQuotes($)+"', missingProperty: '"+C+"', depsCount: "+R.length+", deps: '"+e.util.escapeQuotes(R.length==1?R[0]:R.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",R.length==1?r+="property "+e.util.escapeQuotes(R[0]):r+="properties "+e.util.escapeQuotes(R.join(", ")),r+=" when property "+e.util.escapeQuotes($)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var ie=r;r=L.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+ie+"]); ":r+=" validate.errors = ["+ie+"]; return false; ":r+=" var err = "+ie+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{r+=" ) { ";var J=R;if(J)for(var M,X=-1,G=J.length-1;X<G;){M=J[X+=1];var F=e.util.getProperty(M),C=e.util.escapeQuotes(M),j=m+F;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(I,M,e.opts.jsonPointers)),r+=" if ( "+j+" === undefined ",T&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(M)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { property: '"+e.util.escapeQuotes($)+"', missingProperty: '"+C+"', depsCount: "+R.length+", deps: '"+e.util.escapeQuotes(R.length==1?R[0]:R.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",R.length==1?r+="property "+e.util.escapeQuotes(R[0]):r+="properties "+e.util.escapeQuotes(R.join(", ")),r+=" when property "+e.util.escapeQuotes($)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}r+=" } ",h&&(y+="}",r+=" else { ")}e.errorPath=I;var H=c.baseId;for(var $ in v){var x=v[$];(e.opts.strictKeywords?typeof x=="object"&&Object.keys(x).length>0||x===!1:e.util.schemaHasRules(x,e.RULES.all))&&(r+=" "+_+" = true; if ( "+m+e.util.getProperty($)+" !== undefined ",T&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes($)+"') "),r+=") { ",c.schema=x,c.schemaPath=f+e.util.getProperty($),c.errSchemaPath=d+"/"+e.util.escapeFragment($),r+=" "+e.validate(c)+" ",c.baseId=H,r+=" } ",h&&(r+=" if ("+_+") { ",y+="}"))}return h&&(r+=" "+y+" if ("+E+" == errors) {"),r}});var si=B((eh,ai)=>{"use strict";ai.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E="valid"+n,c=e.opts.$data&&i&&i.$data,y;c?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",y="schema"+n):y=i;var _="i"+n,v="schema"+n;c||(r+=" var "+v+" = validate.schema"+f+";"),r+="var "+E+";",c&&(r+=" if (schema"+n+" === undefined) "+E+" = true; else if (!Array.isArray(schema"+n+")) "+E+" = false; else {"),r+=""+E+" = false;for (var "+_+"=0; "+_+"<"+v+".length; "+_+"++) if (equal("+m+", "+v+"["+_+"])) { "+E+" = true; break; }",c&&(r+=" } "),r+=" if (!"+E+") { ";var P=P||[];P.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { allowedValues: schema"+n+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var T=r;return r=P.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+T+"]); ":r+=" validate.errors = ["+T+"]; return false; ":r+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",h&&(r+=" else { "),r}});var ii=B((rh,ni)=>{"use strict";ni.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||"");if(e.opts.format===!1)return h&&(r+=" if (true) { "),r;var E=e.opts.$data&&i&&i.$data,c;E?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",c="schema"+n):c=i;var y=e.opts.unknownFormats,_=Array.isArray(y);if(E){var v="format"+n,P="isObject"+n,T="formatType"+n;r+=" var "+v+" = formats["+c+"]; var "+P+" = typeof "+v+" == 'object' && !("+v+" instanceof RegExp) && "+v+".validate; var "+T+" = "+P+" && "+v+".type || 'string'; if ("+P+") { ",e.async&&(r+=" var async"+n+" = "+v+".async; "),r+=" "+v+" = "+v+".validate; } if ( ",E&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'string') || "),r+=" (",y!="ignore"&&(r+=" ("+c+" && !"+v+" ",_&&(r+=" && self._opts.unknownFormats.indexOf("+c+") == -1 "),r+=") || "),r+=" ("+v+" && "+T+" == '"+s+"' && !(typeof "+v+" == 'function' ? ",e.async?r+=" (async"+n+" ? await "+v+"("+m+") : "+v+"("+m+")) ":r+=" "+v+"("+m+") ",r+=" : "+v+".test("+m+"))))) {"}else{var v=e.formats[i];if(!v){if(y=="ignore")return e.logger.warn('unknown format "'+i+'" ignored in schema at path "'+e.errSchemaPath+'"'),h&&(r+=" if (true) { "),r;if(_&&y.indexOf(i)>=0)return h&&(r+=" if (true) { "),r;throw new Error('unknown format "'+i+'" is used in schema at path "'+e.errSchemaPath+'"')}var P=typeof v=="object"&&!(v instanceof RegExp)&&v.validate,T=P&&v.type||"string";if(P){var x=v.async===!0;v=v.validate}if(T!=s)return h&&(r+=" if (true) { "),r;if(x){if(!e.async)throw new Error("async format in sync schema");var R="formats"+e.util.getProperty(i)+".validate";r+=" if (!(await "+R+"("+m+"))) { "}else{r+=" if (! ";var R="formats"+e.util.getProperty(i);P&&(R+=".validate"),typeof v=="function"?r+=" "+R+"("+m+") ":r+=" "+R+".test("+m+") ",r+=") { "}}var I=I||[];I.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { format: ",E?r+=""+c:r+=""+e.util.toQuotedString(i),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match format "`,E?r+="' + "+c+" + '":r+=""+e.util.escapeQuotes(i),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+f:r+=""+e.util.toQuotedString(i),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var $=r;return r=I.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+$+"]); ":r+=" validate.errors = ["+$+"]; return false; ":r+=" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",h&&(r+=" else { "),r}});var li=B((th,oi)=>{"use strict";oi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E="valid"+n,c="errs__"+n,y=e.util.copy(e);y.level++;var _="valid"+y.level,v=e.schema.then,P=e.schema.else,T=v!==void 0&&(e.opts.strictKeywords?typeof v=="object"&&Object.keys(v).length>0||v===!1:e.util.schemaHasRules(v,e.RULES.all)),x=P!==void 0&&(e.opts.strictKeywords?typeof P=="object"&&Object.keys(P).length>0||P===!1:e.util.schemaHasRules(P,e.RULES.all)),R=y.baseId;if(T||x){var I;y.createErrors=!1,y.schema=i,y.schemaPath=f,y.errSchemaPath=d,r+=" var "+c+" = errors; var "+E+" = true; ";var $=e.compositeRule;e.compositeRule=y.compositeRule=!0,r+=" "+e.validate(y)+" ",y.baseId=R,y.createErrors=!0,r+=" errors = "+c+"; if (vErrors !== null) { if ("+c+") vErrors.length = "+c+"; else vErrors = null; } ",e.compositeRule=y.compositeRule=$,T?(r+=" if ("+_+") { ",y.schema=e.schema.then,y.schemaPath=e.schemaPath+".then",y.errSchemaPath=e.errSchemaPath+"/then",r+=" "+e.validate(y)+" ",y.baseId=R,r+=" "+E+" = "+_+"; ",T&&x?(I="ifClause"+n,r+=" var "+I+" = 'then'; "):I="'then'",r+=" } ",x&&(r+=" else { ")):r+=" if (!"+_+") { ",x&&(y.schema=e.schema.else,y.schemaPath=e.schemaPath+".else",y.errSchemaPath=e.errSchemaPath+"/else",r+=" "+e.validate(y)+" ",y.baseId=R,r+=" "+E+" = "+_+"; ",T&&x?(I="ifClause"+n,r+=" var "+I+" = 'else'; "):I="'else'",r+=" } "),r+=" if (!"+E+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { failingKeyword: "+I+" } ",e.opts.messages!==!1&&(r+=` , message: 'should match "' + `+I+` + '" schema' `),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } ",h&&(r+=" else { ")}else h&&(r+=" if (true) { ");return r}});var ui=B((ah,ci)=>{"use strict";ci.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E="valid"+n,c="errs__"+n,y=e.util.copy(e),_="";y.level++;var v="valid"+y.level,P="i"+n,T=y.dataLevel=e.dataLevel+1,x="data"+T,R=e.baseId;if(r+="var "+c+" = errors;var "+E+";",Array.isArray(i)){var I=e.schema.additionalItems;if(I===!1){r+=" "+E+" = "+m+".length <= "+i.length+"; ";var $=d;d=e.errSchemaPath+"/additionalItems",r+=" if (!"+E+") { ";var V=V||[];V.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { limit: "+i.length+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have more than "+i.length+" items' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var M=r;r=V.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+M+"]); ":r+=" validate.errors = ["+M+"]; return false; ":r+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",d=$,h&&(_+="}",r+=" else { ")}var A=i;if(A){for(var q,F=-1,j=A.length-1;F<j;)if(q=A[F+=1],e.opts.strictKeywords?typeof q=="object"&&Object.keys(q).length>0||q===!1:e.util.schemaHasRules(q,e.RULES.all)){r+=" "+v+" = true; if ("+m+".length > "+F+") { ";var O=m+"["+F+"]";y.schema=q,y.schemaPath=f+"["+F+"]",y.errSchemaPath=d+"/"+F,y.errorPath=e.util.getPathExpr(e.errorPath,F,e.opts.jsonPointers,!0),y.dataPathArr[T]=F;var C=e.validate(y);y.baseId=R,e.util.varOccurences(C,x)<2?r+=" "+e.util.varReplace(C,x,O)+" ":r+=" var "+x+" = "+O+"; "+C+" ",r+=" } ",h&&(r+=" if ("+v+") { ",_+="}")}}if(typeof I=="object"&&(e.opts.strictKeywords?typeof I=="object"&&Object.keys(I).length>0||I===!1:e.util.schemaHasRules(I,e.RULES.all))){y.schema=I,y.schemaPath=e.schemaPath+".additionalItems",y.errSchemaPath=e.errSchemaPath+"/additionalItems",r+=" "+v+" = true; if ("+m+".length > "+i.length+") { for (var "+P+" = "+i.length+"; "+P+" < "+m+".length; "+P+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,P,e.opts.jsonPointers,!0);var O=m+"["+P+"]";y.dataPathArr[T]=P;var C=e.validate(y);y.baseId=R,e.util.varOccurences(C,x)<2?r+=" "+e.util.varReplace(C,x,O)+" ":r+=" var "+x+" = "+O+"; "+C+" ",h&&(r+=" if (!"+v+") break; "),r+=" } } ",h&&(r+=" if ("+v+") { ",_+="}")}}else if(e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===!1:e.util.schemaHasRules(i,e.RULES.all)){y.schema=i,y.schemaPath=f,y.errSchemaPath=d,r+=" for (var "+P+" = 0; "+P+" < "+m+".length; "+P+"++) { ",y.errorPath=e.util.getPathExpr(e.errorPath,P,e.opts.jsonPointers,!0);var O=m+"["+P+"]";y.dataPathArr[T]=P;var C=e.validate(y);y.baseId=R,e.util.varOccurences(C,x)<2?r+=" "+e.util.varReplace(C,x,O)+" ":r+=" var "+x+" = "+O+"; "+C+" ",h&&(r+=" if (!"+v+") break; "),r+=" }"}return h&&(r+=" "+_+" if ("+c+" == errors) {"),r}});var es=B((sh,di)=>{"use strict";di.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,R,m="data"+(l||""),E=e.opts.$data&&i&&i.$data,c;E?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",c="schema"+n):c=i;var y=t=="maximum",_=y?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[_],P=e.opts.$data&&v&&v.$data,T=y?"<":">",x=y?">":"<",R=void 0;if(!(E||typeof i=="number"||i===void 0))throw new Error(t+" must be number");if(!(P||v===void 0||typeof v=="number"||typeof v=="boolean"))throw new Error(_+" must be number or boolean");if(P){var I=e.util.getData(v.$data,l,e.dataPathArr),$="exclusive"+n,V="exclType"+n,M="exclIsNumber"+n,A="op"+n,q="' + "+A+" + '";r+=" var schemaExcl"+n+" = "+I+"; ",I="schemaExcl"+n,r+=" var "+$+"; var "+V+" = typeof "+I+"; if ("+V+" != 'boolean' && "+V+" != 'undefined' && "+V+" != 'number') { ";var R=_,F=F||[];F.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(R||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: '"+_+" should be boolean' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var j=r;r=F.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+j+"]); ":r+=" validate.errors = ["+j+"]; return false; ":r+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else if ( ",E&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'number') || "),r+=" "+V+" == 'number' ? ( ("+$+" = "+c+" === undefined || "+I+" "+T+"= "+c+") ? "+m+" "+x+"= "+I+" : "+m+" "+x+" "+c+" ) : ( ("+$+" = "+I+" === true) ? "+m+" "+x+"= "+c+" : "+m+" "+x+" "+c+" ) || "+m+" !== "+m+") { var op"+n+" = "+$+" ? '"+T+"' : '"+T+"='; ",i===void 0&&(R=_,d=e.errSchemaPath+"/"+_,c=I,E=P)}else{var M=typeof v=="number",q=T;if(M&&E){var A="'"+q+"'";r+=" if ( ",E&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'number') || "),r+=" ( "+c+" === undefined || "+v+" "+T+"= "+c+" ? "+m+" "+x+"= "+v+" : "+m+" "+x+" "+c+" ) || "+m+" !== "+m+") { "}else{M&&i===void 0?($=!0,R=_,d=e.errSchemaPath+"/"+_,c=v,x+="="):(M&&(c=Math[y?"min":"max"](v,i)),v===(M?c:!0)?($=!0,R=_,d=e.errSchemaPath+"/"+_,x+="="):($=!1,q+="="));var A="'"+q+"'";r+=" if ( ",E&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'number') || "),r+=" "+m+" "+x+" "+c+" || "+m+" !== "+m+") { "}}R=R||t;var F=F||[];F.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(R||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { comparison: "+A+", limit: "+c+", exclusive: "+$+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be "+q+" ",E?r+="' + "+c:r+=""+c+"'"),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+f:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var j=r;return r=F.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+j+"]); ":r+=" validate.errors = ["+j+"]; return false; ":r+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",h&&(r+=" else { "),r}});var rs=B((nh,fi)=>{"use strict";fi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,_,m="data"+(l||""),E=e.opts.$data&&i&&i.$data,c;if(E?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",c="schema"+n):c=i,!(E||typeof i=="number"))throw new Error(t+" must be number");var y=t=="maxItems"?">":"<";r+="if ( ",E&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'number') || "),r+=" "+m+".length "+y+" "+c+") { ";var _=t,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(_||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { limit: "+c+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",t=="maxItems"?r+="more":r+="fewer",r+=" than ",E?r+="' + "+c+" + '":r+=""+i,r+=" items' "),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+f:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var P=r;return r=v.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+P+"]); ":r+=" validate.errors = ["+P+"]; return false; ":r+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",h&&(r+=" else { "),r}});var ts=B((ih,hi)=>{"use strict";hi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,_,m="data"+(l||""),E=e.opts.$data&&i&&i.$data,c;if(E?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",c="schema"+n):c=i,!(E||typeof i=="number"))throw new Error(t+" must be number");var y=t=="maxLength"?">":"<";r+="if ( ",E&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'number') || "),e.opts.unicode===!1?r+=" "+m+".length ":r+=" ucs2length("+m+") ",r+=" "+y+" "+c+") { ";var _=t,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(_||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { limit: "+c+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be ",t=="maxLength"?r+="longer":r+="shorter",r+=" than ",E?r+="' + "+c+" + '":r+=""+i,r+=" characters' "),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+f:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var P=r;return r=v.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+P+"]); ":r+=" validate.errors = ["+P+"]; return false; ":r+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",h&&(r+=" else { "),r}});var as=B((oh,pi)=>{"use strict";pi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,_,m="data"+(l||""),E=e.opts.$data&&i&&i.$data,c;if(E?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",c="schema"+n):c=i,!(E||typeof i=="number"))throw new Error(t+" must be number");var y=t=="maxProperties"?">":"<";r+="if ( ",E&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'number') || "),r+=" Object.keys("+m+").length "+y+" "+c+") { ";var _=t,v=v||[];v.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(_||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { limit: "+c+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",t=="maxProperties"?r+="more":r+="fewer",r+=" than ",E?r+="' + "+c+" + '":r+=""+i,r+=" properties' "),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+f:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var P=r;return r=v.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+P+"]); ":r+=" validate.errors = ["+P+"]; return false; ":r+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",h&&(r+=" else { "),r}});var vi=B((lh,mi)=>{"use strict";mi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E=e.opts.$data&&i&&i.$data,c;if(E?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",c="schema"+n):c=i,!(E||typeof i=="number"))throw new Error(t+" must be number");r+="var division"+n+";if (",E&&(r+=" "+c+" !== undefined && ( typeof "+c+" != 'number' || "),r+=" (division"+n+" = "+m+" / "+c+", ",e.opts.multipleOfPrecision?r+=" Math.abs(Math.round(division"+n+") - division"+n+") > 1e-"+e.opts.multipleOfPrecision+" ":r+=" division"+n+" !== parseInt(division"+n+") ",r+=" ) ",E&&(r+=" ) "),r+=" ) { ";var y=y||[];y.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { multipleOf: "+c+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be multiple of ",E?r+="' + "+c:r+=""+c+"'"),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+f:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var _=r;return r=y.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+_+"]); ":r+=" validate.errors = ["+_+"]; return false; ":r+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",h&&(r+=" else { "),r}});var yi=B((ch,gi)=>{"use strict";gi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E="errs__"+n,c=e.util.copy(e);c.level++;var y="valid"+c.level;if(e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===!1:e.util.schemaHasRules(i,e.RULES.all)){c.schema=i,c.schemaPath=f,c.errSchemaPath=d,r+=" var "+E+" = errors; ";var _=e.compositeRule;e.compositeRule=c.compositeRule=!0,c.createErrors=!1;var v;c.opts.allErrors&&(v=c.opts.allErrors,c.opts.allErrors=!1),r+=" "+e.validate(c)+" ",c.createErrors=!0,v&&(c.opts.allErrors=v),e.compositeRule=c.compositeRule=_,r+=" if ("+y+") { ";var P=P||[];P.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var T=r;r=P.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+T+"]); ":r+=" validate.errors = ["+T+"]; return false; ":r+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { errors = "+E+"; if (vErrors !== null) { if ("+E+") vErrors.length = "+E+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else r+=" var err = ",e.createErrors!==!1?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h&&(r+=" if (false) { ");return r}});var Ei=B((uh,_i)=>{"use strict";_i.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E="valid"+n,c="errs__"+n,y=e.util.copy(e),_="";y.level++;var v="valid"+y.level,P=y.baseId,T="prevValid"+n,x="passingSchemas"+n;r+="var "+c+" = errors , "+T+" = false , "+E+" = false , "+x+" = null; ";var R=e.compositeRule;e.compositeRule=y.compositeRule=!0;var I=i;if(I)for(var $,V=-1,M=I.length-1;V<M;)$=I[V+=1],(e.opts.strictKeywords?typeof $=="object"&&Object.keys($).length>0||$===!1:e.util.schemaHasRules($,e.RULES.all))?(y.schema=$,y.schemaPath=f+"["+V+"]",y.errSchemaPath=d+"/"+V,r+=" "+e.validate(y)+" ",y.baseId=P):r+=" var "+v+" = true; ",V&&(r+=" if ("+v+" && "+T+") { "+E+" = false; "+x+" = ["+x+", "+V+"]; } else { ",_+="}"),r+=" if ("+v+") { "+E+" = "+T+" = true; "+x+" = "+V+"; }";return e.compositeRule=y.compositeRule=R,r+=""+_+"if (!"+E+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { passingSchemas: "+x+" } ",e.opts.messages!==!1&&(r+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+="} else { errors = "+c+"; if (vErrors !== null) { if ("+c+") vErrors.length = "+c+"; else vErrors = null; }",e.opts.allErrors&&(r+=" } "),r}});var bi=B((dh,Si)=>{"use strict";Si.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E=e.opts.$data&&i&&i.$data,c;E?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",c="schema"+n):c=i;var y=E?"(new RegExp("+c+"))":e.usePattern(i);r+="if ( ",E&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'string') || "),r+=" !"+y+".test("+m+") ) { ";var _=_||[];_.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { pattern: ",E?r+=""+c:r+=""+e.util.toQuotedString(i),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match pattern "`,E?r+="' + "+c+" + '":r+=""+e.util.escapeQuotes(i),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+f:r+=""+e.util.toQuotedString(i),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var v=r;return r=_.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+v+"]); ":r+=" validate.errors = ["+v+"]; return false; ":r+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",h&&(r+=" else { "),r}});var xi=B((fh,Pi)=>{"use strict";Pi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E="errs__"+n,c=e.util.copy(e),y="";c.level++;var _="valid"+c.level,v="key"+n,P="idx"+n,T=c.dataLevel=e.dataLevel+1,x="data"+T,R="dataProperties"+n,I=Object.keys(i||{}).filter(X),$=e.schema.patternProperties||{},V=Object.keys($).filter(X),M=e.schema.additionalProperties,A=I.length||V.length,q=M===!1,F=typeof M=="object"&&Object.keys(M).length,j=e.opts.removeAdditional,O=q||F||j,C=e.opts.ownProperties,L=e.baseId,ie=e.schema.required;if(ie&&!(e.opts.$data&&ie.$data)&&ie.length<e.opts.loopRequired)var J=e.util.toHash(ie);function X(Be){return Be!=="__proto__"}if(r+="var "+E+" = errors;var "+_+" = true;",C&&(r+=" var "+R+" = undefined;"),O){if(C?r+=" "+R+" = "+R+" || Object.keys("+m+"); for (var "+P+"=0; "+P+"<"+R+".length; "+P+"++) { var "+v+" = "+R+"["+P+"]; ":r+=" for (var "+v+" in "+m+") { ",A){if(r+=" var isAdditional"+n+" = !(false ",I.length)if(I.length>8)r+=" || validate.schema"+f+".hasOwnProperty("+v+") ";else{var G=I;if(G)for(var H,fe=-1,Pe=G.length-1;fe<Pe;)H=G[fe+=1],r+=" || "+v+" == "+e.util.toQuotedString(H)+" "}if(V.length){var Re=V;if(Re)for(var te,ve=-1,Ee=Re.length-1;ve<Ee;)te=Re[ve+=1],r+=" || "+e.usePattern(te)+".test("+v+") "}r+=" ); if (isAdditional"+n+") { "}if(j=="all")r+=" delete "+m+"["+v+"]; ";else{var Te=e.errorPath,hr="' + "+v+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers)),q)if(j)r+=" delete "+m+"["+v+"]; ";else{r+=" "+_+" = false; ";var sr=d;d=e.errSchemaPath+"/additionalProperties";var ge=ge||[];ge.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { additionalProperty: '"+hr+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is an invalid additional property":r+="should NOT have additional properties",r+="' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var he=r;r=ge.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+he+"]); ":r+=" validate.errors = ["+he+"]; return false; ":r+=" var err = "+he+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d=sr,h&&(r+=" break; ")}else if(F)if(j=="failing"){r+=" var "+E+" = errors; ";var br=e.compositeRule;e.compositeRule=c.compositeRule=!0,c.schema=M,c.schemaPath=e.schemaPath+".additionalProperties",c.errSchemaPath=e.errSchemaPath+"/additionalProperties",c.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var xe=m+"["+v+"]";c.dataPathArr[T]=v;var se=e.validate(c);c.baseId=L,e.util.varOccurences(se,x)<2?r+=" "+e.util.varReplace(se,x,xe)+" ":r+=" var "+x+" = "+xe+"; "+se+" ",r+=" if (!"+_+") { errors = "+E+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+m+"["+v+"]; } ",e.compositeRule=c.compositeRule=br}else{c.schema=M,c.schemaPath=e.schemaPath+".additionalProperties",c.errSchemaPath=e.errSchemaPath+"/additionalProperties",c.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var xe=m+"["+v+"]";c.dataPathArr[T]=v;var se=e.validate(c);c.baseId=L,e.util.varOccurences(se,x)<2?r+=" "+e.util.varReplace(se,x,xe)+" ":r+=" var "+x+" = "+xe+"; "+se+" ",h&&(r+=" if (!"+_+") break; ")}e.errorPath=Te}A&&(r+=" } "),r+=" } ",h&&(r+=" if ("+_+") { ",y+="}")}var pr=e.opts.useDefaults&&!e.compositeRule;if(I.length){var nr=I;if(nr)for(var H,Pr=-1,xr=nr.length-1;Pr<xr;){H=nr[Pr+=1];var Se=i[H];if(e.opts.strictKeywords?typeof Se=="object"&&Object.keys(Se).length>0||Se===!1:e.util.schemaHasRules(Se,e.RULES.all)){var Le=e.util.getProperty(H),xe=m+Le,$e=pr&&Se.default!==void 0;c.schema=Se,c.schemaPath=f+Le,c.errSchemaPath=d+"/"+e.util.escapeFragment(H),c.errorPath=e.util.getPath(e.errorPath,H,e.opts.jsonPointers),c.dataPathArr[T]=e.util.toQuotedString(H);var se=e.validate(c);if(c.baseId=L,e.util.varOccurences(se,x)<2){se=e.util.varReplace(se,x,xe);var Oe=xe}else{var Oe=x;r+=" var "+x+" = "+xe+"; "}if($e)r+=" "+se+" ";else{if(J&&J[H]){r+=" if ( "+Oe+" === undefined ",C&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(H)+"') "),r+=") { "+_+" = false; ";var Te=e.errorPath,sr=d,Ge=e.util.escapeQuotes(H);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(Te,H,e.opts.jsonPointers)),d=e.errSchemaPath+"/required";var ge=ge||[];ge.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+Ge+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+Ge+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var he=r;r=ge.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+he+"]); ":r+=" validate.errors = ["+he+"]; return false; ":r+=" var err = "+he+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d=sr,e.errorPath=Te,r+=" } else { "}else h?(r+=" if ( "+Oe+" === undefined ",C&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(H)+"') "),r+=") { "+_+" = true; } else { "):(r+=" if ("+Oe+" !== undefined ",C&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(H)+"') "),r+=" ) { ");r+=" "+se+" } "}}h&&(r+=" if ("+_+") { ",y+="}")}}if(V.length){var ke=V;if(ke)for(var te,Rt=-1,ma=ke.length-1;Rt<ma;){te=ke[Rt+=1];var Se=$[te];if(e.opts.strictKeywords?typeof Se=="object"&&Object.keys(Se).length>0||Se===!1:e.util.schemaHasRules(Se,e.RULES.all)){c.schema=Se,c.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(te),c.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(te),C?r+=" "+R+" = "+R+" || Object.keys("+m+"); for (var "+P+"=0; "+P+"<"+R+".length; "+P+"++) { var "+v+" = "+R+"["+P+"]; ":r+=" for (var "+v+" in "+m+") { ",r+=" if ("+e.usePattern(te)+".test("+v+")) { ",c.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);var xe=m+"["+v+"]";c.dataPathArr[T]=v;var se=e.validate(c);c.baseId=L,e.util.varOccurences(se,x)<2?r+=" "+e.util.varReplace(se,x,xe)+" ":r+=" var "+x+" = "+xe+"; "+se+" ",h&&(r+=" if (!"+_+") break; "),r+=" } ",h&&(r+=" else "+_+" = true; "),r+=" } ",h&&(r+=" if ("+_+") { ",y+="}")}}}return h&&(r+=" "+y+" if ("+E+" == errors) {"),r}});var Ri=B((hh,wi)=>{"use strict";wi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E="errs__"+n,c=e.util.copy(e),y="";c.level++;var _="valid"+c.level;if(r+="var "+E+" = errors;",e.opts.strictKeywords?typeof i=="object"&&Object.keys(i).length>0||i===!1:e.util.schemaHasRules(i,e.RULES.all)){c.schema=i,c.schemaPath=f,c.errSchemaPath=d;var v="key"+n,P="idx"+n,T="i"+n,x="' + "+v+" + '",R=c.dataLevel=e.dataLevel+1,I="data"+R,$="dataProperties"+n,V=e.opts.ownProperties,M=e.baseId;V&&(r+=" var "+$+" = undefined; "),V?r+=" "+$+" = "+$+" || Object.keys("+m+"); for (var "+P+"=0; "+P+"<"+$+".length; "+P+"++) { var "+v+" = "+$+"["+P+"]; ":r+=" for (var "+v+" in "+m+") { ",r+=" var startErrs"+n+" = errors; ";var A=v,q=e.compositeRule;e.compositeRule=c.compositeRule=!0;var F=e.validate(c);c.baseId=M,e.util.varOccurences(F,I)<2?r+=" "+e.util.varReplace(F,I,A)+" ":r+=" var "+I+" = "+A+"; "+F+" ",e.compositeRule=c.compositeRule=q,r+=" if (!"+_+") { for (var "+T+"=startErrs"+n+"; "+T+"<errors; "+T+"++) { vErrors["+T+"].propertyName = "+v+"; } var err = ",e.createErrors!==!1?(r+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { propertyName: '"+x+"' } ",e.opts.messages!==!1&&(r+=" , message: 'property name \\'"+x+"\\' is invalid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),h&&(r+=" break; "),r+=" } }"}return h&&(r+=" "+y+" if ("+E+" == errors) {"),r}});var Oi=B((ph,Ti)=>{"use strict";Ti.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E="valid"+n,c=e.opts.$data&&i&&i.$data,y;c?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",y="schema"+n):y=i;var _="schema"+n;if(!c)if(i.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var v=[],P=i;if(P)for(var T,x=-1,R=P.length-1;x<R;){T=P[x+=1];var I=e.schema.properties[T];I&&(e.opts.strictKeywords?typeof I=="object"&&Object.keys(I).length>0||I===!1:e.util.schemaHasRules(I,e.RULES.all))||(v[v.length]=T)}}else var v=i;if(c||v.length){var $=e.errorPath,V=c||v.length>=e.opts.loopRequired,M=e.opts.ownProperties;if(h)if(r+=" var missing"+n+"; ",V){c||(r+=" var "+_+" = validate.schema"+f+"; ");var A="i"+n,q="schema"+n+"["+A+"]",F="' + "+q+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr($,q,e.opts.jsonPointers)),r+=" var "+E+" = true; ",c&&(r+=" if (schema"+n+" === undefined) "+E+" = true; else if (!Array.isArray(schema"+n+")) "+E+" = false; else {"),r+=" for (var "+A+" = 0; "+A+" < "+_+".length; "+A+"++) { "+E+" = "+m+"["+_+"["+A+"]] !== undefined ",M&&(r+=" && Object.prototype.hasOwnProperty.call("+m+", "+_+"["+A+"]) "),r+="; if (!"+E+") break; } ",c&&(r+=" } "),r+=" if (!"+E+") { ";var j=j||[];j.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+F+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+F+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var O=r;r=j.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+O+"]); ":r+=" validate.errors = ["+O+"]; return false; ":r+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else{r+=" if ( ";var C=v;if(C)for(var L,A=-1,ie=C.length-1;A<ie;){L=C[A+=1],A&&(r+=" || ");var J=e.util.getProperty(L),X=m+J;r+=" ( ( "+X+" === undefined ",M&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(L)+"') "),r+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?L:J)+") ) "}r+=") { ";var q="missing"+n,F="' + "+q+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr($,q,!0):$+" + "+q);var j=j||[];j.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+F+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+F+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var O=r;r=j.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+O+"]); ":r+=" validate.errors = ["+O+"]; return false; ":r+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else if(V){c||(r+=" var "+_+" = validate.schema"+f+"; ");var A="i"+n,q="schema"+n+"["+A+"]",F="' + "+q+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr($,q,e.opts.jsonPointers)),c&&(r+=" if ("+_+" && !Array.isArray("+_+")) { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+F+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+F+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+_+" !== undefined) { "),r+=" for (var "+A+" = 0; "+A+" < "+_+".length; "+A+"++) { if ("+m+"["+_+"["+A+"]] === undefined ",M&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", "+_+"["+A+"]) "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+F+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+F+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",c&&(r+=" } ")}else{var G=v;if(G)for(var L,H=-1,fe=G.length-1;H<fe;){L=G[H+=1];var J=e.util.getProperty(L),F=e.util.escapeQuotes(L),X=m+J;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath($,L,e.opts.jsonPointers)),r+=" if ( "+X+" === undefined ",M&&(r+=" || ! Object.prototype.hasOwnProperty.call("+m+", '"+e.util.escapeQuotes(L)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+F+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+F+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=$}else h&&(r+=" if (true) {");return r}});var $i=B((mh,Ii)=>{"use strict";Ii.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m="data"+(l||""),E="valid"+n,c=e.opts.$data&&i&&i.$data,y;if(c?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",y="schema"+n):y=i,(i||c)&&e.opts.uniqueItems!==!1){c&&(r+=" var "+E+"; if ("+y+" === false || "+y+" === undefined) "+E+" = true; else if (typeof "+y+" != 'boolean') "+E+" = false; else { "),r+=" var i = "+m+".length , "+E+" = true , j; if (i > 1) { ";var _=e.schema.items&&e.schema.items.type,v=Array.isArray(_);if(!_||_=="object"||_=="array"||v&&(_.indexOf("object")>=0||_.indexOf("array")>=0))r+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+m+"[i], "+m+"[j])) { "+E+" = false; break outer; } } } ";else{r+=" var itemIndices = {}, item; for (;i--;) { var item = "+m+"[i]; ";var P="checkDataType"+(v?"s":"");r+=" if ("+e.util[P](_,"item",e.opts.strictNumbers,!0)+") continue; ",v&&(r+=` if (typeof item == 'string') item = '"' + item; `),r+=" if (typeof itemIndices[item] == 'number') { "+E+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}r+=" } ",c&&(r+=" } "),r+=" if (!"+E+") { ";var T=T||[];T.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(r+=" , schema: ",c?r+="validate.schema"+f:r+=""+i,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var x=r;r=T.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",h&&(r+=" else { ")}else h&&(r+=" if (true) { ");return r}});var Ci=B((vh,Ai)=>{"use strict";Ai.exports={$ref:zn(),allOf:Bn(),anyOf:Zn(),$comment:Gn(),const:Yn(),contains:ei(),dependencies:ti(),enum:si(),format:ii(),if:li(),items:ui(),maximum:es(),minimum:es(),maxItems:rs(),minItems:rs(),maxLength:ts(),minLength:ts(),maxProperties:as(),minProperties:as(),multipleOf:vi(),not:yi(),oneOf:Ei(),pattern:bi(),properties:xi(),propertyNames:Ri(),required:Oi(),uniqueItems:$i(),validate:Ya()}});var Ni=B((gh,ki)=>{"use strict";var Di=Ci(),ss=zr().toHash;ki.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"],s=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],r=["number","integer","string","array","object","boolean","null"];return e.all=ss(t),e.types=ss(r),e.forEach(function(n){n.rules=n.rules.map(function(l){var i;if(typeof l=="object"){var f=Object.keys(l)[0];i=l[f],l=f,i.forEach(function(h){t.push(h),e.all[h]=!0})}t.push(l);var d=e.all[l]={keyword:l,code:Di[l],implements:i};return d}),e.all.$comment={keyword:"$comment",code:Di.$comment},n.type&&(e.types[n.type]=n)}),e.keywords=ss(t.concat(s)),e.custom={},e}});var Fi=B((yh,Li)=>{"use strict";var ji=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];Li.exports=function(a,e){for(var t=0;t<e.length;t++){a=JSON.parse(JSON.stringify(a));var s=e[t].split("/"),r=a,n;for(n=1;n<s.length;n++)r=r[s[n]];for(n=0;n<ji.length;n++){var l=ji[n],i=r[l];i&&(r[l]={anyOf:[i,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return a}});var Ui=B((_h,qi)=>{"use strict";var Ku=Xt().MissingRef;qi.exports=Mi;function Mi(a,e,t){var s=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof e=="function"&&(t=e,e=void 0);var r=n(a).then(function(){var i=s._addSchema(a,void 0,e);return i.validate||l(i)});return t&&r.then(function(i){t(null,i)},t),r;function n(i){var f=i.$schema;return f&&!s.getSchema(f)?Mi.call(s,{$ref:f},!0):Promise.resolve()}function l(i){try{return s._compile(i)}catch(d){if(d instanceof Ku)return f(d);throw d}function f(d){var h=d.missingSchema;if(c(h))throw new Error("Schema "+h+" is loaded but "+d.missingRef+" cannot be resolved");var m=s._loadingSchemas[h];return m||(m=s._loadingSchemas[h]=s._opts.loadSchema(h),m.then(E,E)),m.then(function(y){if(!c(h))return n(y).then(function(){c(h)||s.addSchema(y,h,void 0,e)})}).then(function(){return l(i)});function E(){delete s._loadingSchemas[h]}function c(y){return s._refs[y]||s._schemas[y]}}}}});var Hi=B((Eh,Vi)=>{"use strict";Vi.exports=function(e,t,s){var r=" ",n=e.level,l=e.dataLevel,i=e.schema[t],f=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,m,E="data"+(l||""),c="valid"+n,y="errs__"+n,_=e.opts.$data&&i&&i.$data,v;_?(r+=" var schema"+n+" = "+e.util.getData(i.$data,l,e.dataPathArr)+"; ",v="schema"+n):v=i;var P=this,T="definition"+n,x=P.definition,R="",I,$,V,M,A;if(_&&x.$data){A="keywordValidate"+n;var q=x.validateSchema;r+=" var "+T+" = RULES.custom['"+t+"'].definition; var "+A+" = "+T+".validate;"}else{if(M=e.useCustomRule(P,i,e.schema,e),!M)return;v="validate.schema"+f,A=M.code,I=x.compile,$=x.inline,V=x.macro}var F=A+".errors",j="i"+n,O="ruleErr"+n,C=x.async;if(C&&!e.async)throw new Error("async keyword in sync schema");if($||V||(r+=""+F+" = null;"),r+="var "+y+" = errors;var "+c+";",_&&x.$data&&(R+="}",r+=" if ("+v+" === undefined) { "+c+" = true; } else { ",q&&(R+="}",r+=" "+c+" = "+T+".validateSchema("+v+"); if ("+c+") { ")),$)x.statements?r+=" "+M.validate+" ":r+=" "+c+" = "+M.validate+"; ";else if(V){var L=e.util.copy(e),R="";L.level++;var ie="valid"+L.level;L.schema=M.validate,L.schemaPath="";var J=e.compositeRule;e.compositeRule=L.compositeRule=!0;var X=e.validate(L).replace(/validate\.schema/g,A);e.compositeRule=L.compositeRule=J,r+=" "+X}else{var G=G||[];G.push(r),r="",r+=" "+A+".call( ",e.opts.passContext?r+="this":r+="self",I||x.schema===!1?r+=" , "+E+" ":r+=" , "+v+" , "+E+" , validate.schema"+e.schemaPath+" ",r+=" , (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var H=l?"data"+(l-1||""):"parentData",fe=l?e.dataPathArr[l]:"parentDataProperty";r+=" , "+H+" , "+fe+" , rootData ) ";var Pe=r;r=G.pop(),x.errors===!1?(r+=" "+c+" = ",C&&(r+="await "),r+=""+Pe+"; "):C?(F="customErrors"+n,r+=" var "+F+" = null; try { "+c+" = await "+Pe+"; } catch (e) { "+c+" = false; if (e instanceof ValidationError) "+F+" = e.errors; else throw e; } "):r+=" "+F+" = null; "+c+" = "+Pe+"; "}if(x.modifying&&(r+=" if ("+H+") "+E+" = "+H+"["+fe+"];"),r+=""+R,x.valid)h&&(r+=" if (true) { ");else{r+=" if ( ",x.valid===void 0?(r+=" !",V?r+=""+ie:r+=""+c):r+=" "+!x.valid+" ",r+=") { ",m=P.keyword;var G=G||[];G.push(r),r="";var G=G||[];G.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(m||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+P.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+P.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+E+" "),r+=" } "):r+=" {} ";var Re=r;r=G.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+Re+"]); ":r+=" validate.errors = ["+Re+"]; return false; ":r+=" var err = "+Re+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var te=r;r=G.pop(),$?x.errors?x.errors!="full"&&(r+=" for (var "+j+"="+y+"; "+j+"<errors; "+j+"++) { var "+O+" = vErrors["+j+"]; if ("+O+".dataPath === undefined) "+O+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+O+".schemaPath === undefined) { "+O+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(r+=" "+O+".schema = "+v+"; "+O+".data = "+E+"; "),r+=" } "):x.errors===!1?r+=" "+te+" ":(r+=" if ("+y+" == errors) { "+te+" } else { for (var "+j+"="+y+"; "+j+"<errors; "+j+"++) { var "+O+" = vErrors["+j+"]; if ("+O+".dataPath === undefined) "+O+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+O+".schemaPath === undefined) { "+O+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(r+=" "+O+".schema = "+v+"; "+O+".data = "+E+"; "),r+=" } } "):V?(r+=" var err = ",e.createErrors!==!1?(r+=" { keyword: '"+(m||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+P.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+P.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+E+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; ")):x.errors===!1?r+=" "+te+" ":(r+=" if (Array.isArray("+F+")) { if (vErrors === null) vErrors = "+F+"; else vErrors = vErrors.concat("+F+"); errors = vErrors.length; for (var "+j+"="+y+"; "+j+"<errors; "+j+"++) { var "+O+" = vErrors["+j+"]; if ("+O+".dataPath === undefined) "+O+".dataPath = (dataPath || '') + "+e.errorPath+"; "+O+'.schemaPath = "'+d+'"; ',e.opts.verbose&&(r+=" "+O+".schema = "+v+"; "+O+".data = "+E+"; "),r+=" } } else { "+te+" } "),r+=" } ",h&&(r+=" else { ")}return r}});var ns=B((Sh,Gu)=>{Gu.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Bi=B((bh,Wi)=>{"use strict";var zi=ns();Wi.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:zi.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:zi.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}});var Zi=B((Ph,Qi)=>{"use strict";var Ju=/^[a-z_$][a-z0-9_$-]*$/i,Yu=Hi(),Xu=Bi();Qi.exports={add:ed,get:rd,remove:td,validate:is};function ed(a,e){var t=this.RULES;if(t.keywords[a])throw new Error("Keyword "+a+" is already defined");if(!Ju.test(a))throw new Error("Keyword "+a+" is not a valid identifier");if(e){this.validateKeyword(e,!0);var s=e.type;if(Array.isArray(s))for(var r=0;r<s.length;r++)l(a,s[r],e);else l(a,s,e);var n=e.metaSchema;n&&(e.$data&&this._opts.$data&&(n={anyOf:[n,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),e.validateSchema=this.compile(n,!0))}t.keywords[a]=t.all[a]=!0;function l(i,f,d){for(var h,m=0;m<t.length;m++){var E=t[m];if(E.type==f){h=E;break}}h||(h={type:f,rules:[]},t.push(h));var c={keyword:i,definition:d,custom:!0,code:Yu,implements:d.implements};h.rules.push(c),t.custom[i]=c}return this}function rd(a){var e=this.RULES.custom[a];return e?e.definition:this.RULES.keywords[a]||!1}function td(a){var e=this.RULES;delete e.keywords[a],delete e.all[a],delete e.custom[a];for(var t=0;t<e.length;t++)for(var s=e[t].rules,r=0;r<s.length;r++)if(s[r].keyword==a){s.splice(r,1);break}return this}function is(a,e){is.errors=null;var t=this._validateKeyword=this._validateKeyword||this.compile(Xu,!0);if(t(a))return!0;if(is.errors=t.errors,e)throw new Error("custom keyword definition is invalid: "+this.errorsText(t.errors));return!1}});var Ki=B((xh,ad)=>{ad.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var no=B((wh,so)=>{"use strict";var Ji=On(),Wr=Yt(),sd=$n(),Yi=Wa(),nd=Ja(),id=Vn(),od=Ni(),Xi=Fi(),eo=zr();so.exports=pe;pe.prototype.validate=cd;pe.prototype.compile=ud;pe.prototype.addSchema=dd;pe.prototype.addMetaSchema=fd;pe.prototype.validateSchema=hd;pe.prototype.getSchema=md;pe.prototype.removeSchema=gd;pe.prototype.addFormat=wd;pe.prototype.errorsText=xd;pe.prototype._addSchema=yd;pe.prototype._compile=_d;pe.prototype.compileAsync=Ui();var oa=Zi();pe.prototype.addKeyword=oa.add;pe.prototype.getKeyword=oa.get;pe.prototype.removeKeyword=oa.remove;pe.prototype.validateKeyword=oa.validate;var ro=Xt();pe.ValidationError=ro.Validation;pe.MissingRefError=ro.MissingRef;pe.$dataMetaSchema=Xi;var ia="http://json-schema.org/draft-07/schema",Gi=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],ld=["/properties"];function pe(a){if(!(this instanceof pe))return new pe(a);a=this._opts=eo.copy(a)||{},Ad(this),this._schemas={},this._refs={},this._fragments={},this._formats=id(a.format),this._cache=a.cache||new sd,this._loadingSchemas={},this._compilations=[],this.RULES=od(),this._getId=Ed(a),a.loopRequired=a.loopRequired||1/0,a.errorDataPath=="property"&&(a._errorDataPathProperty=!0),a.serialize===void 0&&(a.serialize=nd),this._metaOpts=$d(this),a.formats&&Od(this),a.keywords&&Id(this),Rd(this),typeof a.meta=="object"&&this.addMetaSchema(a.meta),a.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),Td(this)}function cd(a,e){var t;if(typeof a=="string"){if(t=this.getSchema(a),!t)throw new Error('no schema with key or ref "'+a+'"')}else{var s=this._addSchema(a);t=s.validate||this._compile(s)}var r=t(e);return t.$async!==!0&&(this.errors=t.errors),r}function ud(a,e){var t=this._addSchema(a,void 0,e);return t.validate||this._compile(t)}function dd(a,e,t,s){if(Array.isArray(a)){for(var r=0;r<a.length;r++)this.addSchema(a[r],void 0,t,s);return this}var n=this._getId(a);if(n!==void 0&&typeof n!="string")throw new Error("schema id must be string");return e=Wr.normalizeId(e||n),ao(this,e),this._schemas[e]=this._addSchema(a,t,s,!0),this}function fd(a,e,t){return this.addSchema(a,e,t,!0),this}function hd(a,e){var t=a.$schema;if(t!==void 0&&typeof t!="string")throw new Error("$schema must be a string");if(t=t||this._opts.defaultMeta||pd(this),!t)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var s=this.validate(t,a);if(!s&&e){var r="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(r);else throw new Error(r)}return s}function pd(a){var e=a._opts.meta;return a._opts.defaultMeta=typeof e=="object"?a._getId(e)||e:a.getSchema(ia)?ia:void 0,a._opts.defaultMeta}function md(a){var e=to(this,a);switch(typeof e){case"object":return e.validate||this._compile(e);case"string":return this.getSchema(e);case"undefined":return vd(this,a)}}function vd(a,e){var t=Wr.schema.call(a,{schema:{}},e);if(t){var s=t.schema,r=t.root,n=t.baseId,l=Ji.call(a,s,r,void 0,n);return a._fragments[e]=new Yi({ref:e,fragment:!0,schema:s,root:r,baseId:n,validate:l}),l}}function to(a,e){return e=Wr.normalizeId(e),a._schemas[e]||a._refs[e]||a._fragments[e]}function gd(a){if(a instanceof RegExp)return na(this,this._schemas,a),na(this,this._refs,a),this;switch(typeof a){case"undefined":return na(this,this._schemas),na(this,this._refs),this._cache.clear(),this;case"string":var e=to(this,a);return e&&this._cache.del(e.cacheKey),delete this._schemas[a],delete this._refs[a],this;case"object":var t=this._opts.serialize,s=t?t(a):a;this._cache.del(s);var r=this._getId(a);r&&(r=Wr.normalizeId(r),delete this._schemas[r],delete this._refs[r])}return this}function na(a,e,t){for(var s in e){var r=e[s];!r.meta&&(!t||t.test(s))&&(a._cache.del(r.cacheKey),delete e[s])}}function yd(a,e,t,s){if(typeof a!="object"&&typeof a!="boolean")throw new Error("schema should be object or boolean");var r=this._opts.serialize,n=r?r(a):a,l=this._cache.get(n);if(l)return l;s=s||this._opts.addUsedSchema!==!1;var i=Wr.normalizeId(this._getId(a));i&&s&&ao(this,i);var f=this._opts.validateSchema!==!1&&!e,d;f&&!(d=i&&i==Wr.normalizeId(a.$schema))&&this.validateSchema(a,!0);var h=Wr.ids.call(this,a),m=new Yi({id:i,schema:a,localRefs:h,cacheKey:n,meta:t});return i[0]!="#"&&s&&(this._refs[i]=m),this._cache.put(n,m),f&&d&&this.validateSchema(a,!0),m}function _d(a,e){if(a.compiling)return a.validate=r,r.schema=a.schema,r.errors=null,r.root=e||r,a.schema.$async===!0&&(r.$async=!0),r;a.compiling=!0;var t;a.meta&&(t=this._opts,this._opts=this._metaOpts);var s;try{s=Ji.call(this,a.schema,e,a.localRefs)}catch(n){throw delete a.validate,n}finally{a.compiling=!1,a.meta&&(this._opts=t)}return a.validate=s,a.refs=s.refs,a.refVal=s.refVal,a.root=s.root,s;function r(){var n=a.validate,l=n.apply(this,arguments);return r.errors=n.errors,l}}function Ed(a){switch(a.schemaId){case"auto":return Pd;case"id":return Sd;default:return bd}}function Sd(a){return a.$id&&this.logger.warn("schema $id ignored",a.$id),a.id}function bd(a){return a.id&&this.logger.warn("schema id ignored",a.id),a.$id}function Pd(a){if(a.$id&&a.id&&a.$id!=a.id)throw new Error("schema $id is different from id");return a.$id||a.id}function xd(a,e){if(a=a||this.errors,!a)return"No errors";e=e||{};for(var t=e.separator===void 0?", ":e.separator,s=e.dataVar===void 0?"data":e.dataVar,r="",n=0;n<a.length;n++){var l=a[n];l&&(r+=s+l.dataPath+" "+l.message+t)}return r.slice(0,-t.length)}function wd(a,e){return typeof e=="string"&&(e=new RegExp(e)),this._formats[a]=e,this}function Rd(a){var e;if(a._opts.$data&&(e=Ki(),a.addMetaSchema(e,e.$id,!0)),a._opts.meta!==!1){var t=ns();a._opts.$data&&(t=Xi(t,ld)),a.addMetaSchema(t,ia,!0),a._refs["http://json-schema.org/schema"]=ia}}function Td(a){var e=a._opts.schemas;if(e)if(Array.isArray(e))a.addSchema(e);else for(var t in e)a.addSchema(e[t],t)}function Od(a){for(var e in a._opts.formats){var t=a._opts.formats[e];a.addFormat(e,t)}}function Id(a){for(var e in a._opts.keywords){var t=a._opts.keywords[e];a.addKeyword(e,t)}}function ao(a,e){if(a._schemas[e]||a._refs[e])throw new Error('schema with key or id "'+e+'" already exists')}function $d(a){for(var e=eo.copy(a._opts),t=0;t<Gi.length;t++)delete e[Gi[t]];return e}function Ad(a){var e=a._opts.logger;if(e===!1)a.logger={log:os,warn:os,error:os};else{if(e===void 0&&(e=console),!(typeof e=="object"&&e.log&&e.warn&&e.error))throw new Error("logger must implement log, warn and error methods");a.logger=e}}function os(){}});var o={};Bo(o,{BRAND:()=>_l,DIRTY:()=>Or,EMPTY_PATH:()=>Jo,INVALID:()=>z,NEVER:()=>ac,OK:()=>we,ParseStatus:()=>be,Schema:()=>K,ZodAny:()=>gr,ZodArray:()=>fr,ZodBigInt:()=>$r,ZodBoolean:()=>Ar,ZodBranded:()=>gt,ZodCatch:()=>Vr,ZodDate:()=>Cr,ZodDefault:()=>Ur,ZodDiscriminatedUnion:()=>Ct,ZodEffects:()=>Ve,ZodEnum:()=>Mr,ZodError:()=>Ae,ZodFirstPartyTypeKind:()=>W,ZodFunction:()=>kt,ZodIntersection:()=>jr,ZodIssueCode:()=>w,ZodLazy:()=>Lr,ZodLiteral:()=>Fr,ZodMap:()=>st,ZodNaN:()=>it,ZodNativeEnum:()=>qr,ZodNever:()=>Qe,ZodNull:()=>kr,ZodNullable:()=>rr,ZodNumber:()=>Ir,ZodObject:()=>Ce,ZodOptional:()=>qe,ZodParsedType:()=>k,ZodPipeline:()=>yt,ZodPromise:()=>yr,ZodReadonly:()=>Hr,ZodRecord:()=>Dt,ZodSchema:()=>K,ZodSet:()=>nt,ZodString:()=>vr,ZodSymbol:()=>tt,ZodTransformer:()=>Ve,ZodTuple:()=>er,ZodType:()=>K,ZodUndefined:()=>Dr,ZodUnion:()=>Nr,ZodUnknown:()=>dr,ZodVoid:()=>at,addIssueToContext:()=>D,any:()=>Ol,array:()=>Cl,bigint:()=>Pl,boolean:()=>Fs,coerce:()=>tc,custom:()=>Ns,date:()=>xl,datetimeRegex:()=>Ds,defaultErrorMap:()=>cr,discriminatedUnion:()=>jl,effect:()=>Zl,enum:()=>Wl,function:()=>Vl,getErrorMap:()=>Xr,getParsedType:()=>Xe,instanceof:()=>Sl,intersection:()=>Ll,isAborted:()=>$t,isAsync:()=>et,isDirty:()=>At,isValid:()=>mr,late:()=>El,lazy:()=>Hl,literal:()=>zl,makeIssue:()=>vt,map:()=>ql,nan:()=>bl,nativeEnum:()=>Bl,never:()=>$l,null:()=>Tl,nullable:()=>Gl,number:()=>Ls,object:()=>Dl,objectUtil:()=>Sa,oboolean:()=>rc,onumber:()=>ec,optional:()=>Kl,ostring:()=>Xl,pipeline:()=>Yl,preprocess:()=>Jl,promise:()=>Ql,quotelessJson:()=>Zo,record:()=>Ml,set:()=>Ul,setErrorMap:()=>Go,strictObject:()=>kl,string:()=>js,symbol:()=>wl,transformer:()=>Zl,tuple:()=>Fl,undefined:()=>Rl,union:()=>Nl,unknown:()=>Il,util:()=>Y,void:()=>Al});var Y;(function(a){a.assertEqual=r=>{};function e(r){}a.assertIs=e;function t(r){throw new Error}a.assertNever=t,a.arrayToEnum=r=>{let n={};for(let l of r)n[l]=l;return n},a.getValidEnumValues=r=>{let n=a.objectKeys(r).filter(i=>typeof r[r[i]]!="number"),l={};for(let i of n)l[i]=r[i];return a.objectValues(l)},a.objectValues=r=>a.objectKeys(r).map(function(n){return r[n]}),a.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let n=[];for(let l in r)Object.prototype.hasOwnProperty.call(r,l)&&n.push(l);return n},a.find=(r,n)=>{for(let l of r)if(n(l))return l},a.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,n=" | "){return r.map(l=>typeof l=="string"?`'${l}'`:l).join(n)}a.joinValues=s,a.jsonStringifyReplacer=(r,n)=>typeof n=="bigint"?n.toString():n})(Y||(Y={}));var Sa;(function(a){a.mergeShapes=(e,t)=>({...e,...t})})(Sa||(Sa={}));var k=Y.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xe=a=>{switch(typeof a){case"undefined":return k.undefined;case"string":return k.string;case"number":return Number.isNaN(a)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(a)?k.array:a===null?k.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?k.promise:typeof Map<"u"&&a instanceof Map?k.map:typeof Set<"u"&&a instanceof Set?k.set:typeof Date<"u"&&a instanceof Date?k.date:k.object;default:return k.unknown}};var w=Y.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Zo=a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:"),Ae=class a extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(n){return n.message},s={_errors:[]},r=n=>{for(let l of n.issues)if(l.code==="invalid_union")l.unionErrors.map(r);else if(l.code==="invalid_return_type")r(l.returnTypeError);else if(l.code==="invalid_arguments")r(l.argumentsError);else if(l.path.length===0)s._errors.push(t(l));else{let i=s,f=0;for(;f<l.path.length;){let d=l.path[f];f===l.path.length-1?(i[d]=i[d]||{_errors:[]},i[d]._errors.push(t(l))):i[d]=i[d]||{_errors:[]},i=i[d],f++}}};return r(this),s}static assert(e){if(!(e instanceof a))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Y.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},s=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}};Ae.create=a=>new Ae(a);var Ko=(a,e)=>{let t;switch(a.code){case w.invalid_type:a.received===k.undefined?t="Required":t=`Expected ${a.expected}, received ${a.received}`;break;case w.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(a.expected,Y.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:t=`Unrecognized key(s) in object: ${Y.joinValues(a.keys,", ")}`;break;case w.invalid_union:t="Invalid input";break;case w.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Y.joinValues(a.options)}`;break;case w.invalid_enum_value:t=`Invalid enum value. Expected ${Y.joinValues(a.options)}, received '${a.received}'`;break;case w.invalid_arguments:t="Invalid function arguments";break;case w.invalid_return_type:t="Invalid function return type";break;case w.invalid_date:t="Invalid date";break;case w.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(t=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?t=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?t=`Invalid input: must end with "${a.validation.endsWith}"`:Y.assertNever(a.validation):a.validation!=="regex"?t=`Invalid ${a.validation}`:t="Invalid";break;case w.too_small:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:t="Invalid input";break;case w.too_big:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?t=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:t="Invalid input";break;case w.custom:t="Invalid input";break;case w.invalid_intersection_types:t="Intersection results could not be merged";break;case w.not_multiple_of:t=`Number must be a multiple of ${a.multipleOf}`;break;case w.not_finite:t="Number must be finite";break;default:t=e.defaultError,Y.assertNever(a)}return{message:t}},cr=Ko;var Os=cr;function Go(a){Os=a}function Xr(){return Os}var vt=a=>{let{data:e,path:t,errorMaps:s,issueData:r}=a,n=[...t,...r.path||[]],l={...r,path:n};if(r.message!==void 0)return{...r,path:n,message:r.message};let i="",f=s.filter(d=>!!d).slice().reverse();for(let d of f)i=d(l,{data:e,defaultError:i}).message;return{...r,path:n,message:i}},Jo=[];function D(a,e){let t=Xr(),s=vt({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,t,t===cr?void 0:cr].filter(r=>!!r)});a.common.issues.push(s)}var be=class a{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let s=[];for(let r of t){if(r.status==="aborted")return z;r.status==="dirty"&&e.dirty(),s.push(r.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){let s=[];for(let r of t){let n=await r.key,l=await r.value;s.push({key:n,value:l})}return a.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let r of t){let{key:n,value:l}=r;if(n.status==="aborted"||l.status==="aborted")return z;n.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof l.value<"u"||r.alwaysSet)&&(s[n.value]=l.value)}return{status:e.value,value:s}}},z=Object.freeze({status:"aborted"}),Or=a=>({status:"dirty",value:a}),we=a=>({status:"valid",value:a}),$t=a=>a.status==="aborted",At=a=>a.status==="dirty",mr=a=>a.status==="valid",et=a=>typeof Promise<"u"&&a instanceof Promise;var U;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e?.message})(U||(U={}));var Ue=class{constructor(e,t,s,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Is=(a,e)=>{if(mr(e))return{success:!0,data:e.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new Ae(a.common.issues);return this._error=t,this._error}}};function Q(a){if(!a)return{};let{errorMap:e,invalid_type_error:t,required_error:s,description:r}=a;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(l,i)=>{let{message:f}=a;return l.code==="invalid_enum_value"?{message:f??i.defaultError}:typeof i.data>"u"?{message:f??s??i.defaultError}:l.code!=="invalid_type"?{message:i.defaultError}:{message:f??t??i.defaultError}},description:r}}var K=class{get description(){return this._def.description}_getType(e){return Xe(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Xe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new be,ctx:{common:e.parent.common,data:e.data,parsedType:Xe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(et(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){let s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xe(e)},r=this._parseSync({data:e,path:s.path,parent:s});return Is(s,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xe(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:t});return mr(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>mr(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){let s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){let s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xe(e)},r=this._parse({data:e,path:s.path,parent:s}),n=await(et(r)?r:Promise.resolve(r));return Is(s,n)}refine(e,t){let s=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,n)=>{let l=e(r),i=()=>n.addIssue({code:w.custom,...s(r)});return typeof Promise<"u"&&l instanceof Promise?l.then(f=>f?!0:(i(),!1)):l?!0:(i(),!1)})}refinement(e,t){return this._refinement((s,r)=>e(s)?!0:(r.addIssue(typeof t=="function"?t(s,r):t),!1))}_refinement(e){return new Ve({schema:this,typeName:W.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return qe.create(this,this._def)}nullable(){return rr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fr.create(this)}promise(){return yr.create(this,this._def)}or(e){return Nr.create([this,e],this._def)}and(e){return jr.create(this,e,this._def)}transform(e){return new Ve({...Q(this._def),schema:this,typeName:W.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Ur({...Q(this._def),innerType:this,defaultValue:t,typeName:W.ZodDefault})}brand(){return new gt({typeName:W.ZodBranded,type:this,...Q(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Vr({...Q(this._def),innerType:this,catchValue:t,typeName:W.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return yt.create(this,e)}readonly(){return Hr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Yo=/^c[^\s-]{8,}$/i,Xo=/^[0-9a-z]+$/,el=/^[0-9A-HJKMNP-TV-Z]{26}$/i,rl=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,tl=/^[a-z0-9_-]{21}$/i,al=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,sl=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,nl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,il="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ba,ol=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ll=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,cl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ul=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,fl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,As="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",hl=new RegExp(`^${As}$`);function Cs(a){let e="[0-5]\\d";a.precision?e=`${e}\\.\\d{${a.precision}}`:a.precision==null&&(e=`${e}(\\.\\d+)?`);let t=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function pl(a){return new RegExp(`^${Cs(a)}$`)}function Ds(a){let e=`${As}T${Cs(a)}`,t=[];return t.push(a.local?"Z?":"Z"),a.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ml(a,e){return!!((e==="v4"||!e)&&ol.test(a)||(e==="v6"||!e)&&cl.test(a))}function vl(a,e){if(!al.test(a))return!1;try{let[t]=a.split(".");if(!t)return!1;let s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(s));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function gl(a,e){return!!((e==="v4"||!e)&&ll.test(a)||(e==="v6"||!e)&&ul.test(a))}var vr=class a extends K{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){let n=this._getOrReturnCtx(e);return D(n,{code:w.invalid_type,expected:k.string,received:n.parsedType}),z}let s=new be,r;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:w.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="max")e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:w.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="length"){let l=e.data.length>n.value,i=e.data.length<n.value;(l||i)&&(r=this._getOrReturnCtx(e,r),l?D(r,{code:w.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):i&&D(r,{code:w.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),s.dirty())}else if(n.kind==="email")nl.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"email",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")ba||(ba=new RegExp(il,"u")),ba.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"emoji",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")rl.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"uuid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")tl.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"nanoid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")Yo.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cuid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")Xo.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cuid2",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")el.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"ulid",code:w.invalid_string,message:n.message}),s.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),D(r,{validation:"url",code:w.invalid_string,message:n.message}),s.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"regex",code:w.invalid_string,message:n.message}),s.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),D(r,{code:w.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),s.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),D(r,{code:w.invalid_string,validation:{startsWith:n.value},message:n.message}),s.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),D(r,{code:w.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?Ds(n).test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:w.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?hl.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:w.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?pl(n).test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:w.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?sl.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"duration",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?ml(e.data,n.version)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"ip",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?vl(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"jwt",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?gl(e.data,n.version)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cidr",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?dl.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"base64",code:w.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?fl.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"base64url",code:w.invalid_string,message:n.message}),s.dirty()):Y.assertNever(n);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(r=>e.test(r),{validation:t,code:w.invalid_string,...U.errToObj(s)})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...U.errToObj(e)})}url(e){return this._addCheck({kind:"url",...U.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...U.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...U.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...U.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...U.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...U.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...U.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...U.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...U.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...U.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...U.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...U.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...U.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...U.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...U.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...U.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...U.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...U.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...U.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...U.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...U.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...U.errToObj(t)})}nonempty(e){return this.min(1,U.errToObj(e))}trim(){return new a({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new a({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new a({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};vr.create=a=>new vr({checks:[],typeName:W.ZodString,coerce:a?.coerce??!1,...Q(a)});function yl(a,e){let t=(a.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,r=t>s?t:s,n=Number.parseInt(a.toFixed(r).replace(".","")),l=Number.parseInt(e.toFixed(r).replace(".",""));return n%l/10**r}var Ir=class a extends K{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==k.number){let n=this._getOrReturnCtx(e);return D(n,{code:w.invalid_type,expected:k.number,received:n.parsedType}),z}let s,r=new be;for(let n of this._def.checks)n.kind==="int"?Y.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),D(s,{code:w.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),D(s,{code:w.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),D(s,{code:w.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):n.kind==="multipleOf"?yl(e.data,n.value)!==0&&(s=this._getOrReturnCtx(e,s),D(s,{code:w.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),D(s,{code:w.not_finite,message:n.message}),r.dirty()):Y.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,U.toString(t))}gt(e,t){return this.setLimit("min",e,!1,U.toString(t))}lte(e,t){return this.setLimit("max",e,!0,U.toString(t))}lt(e,t){return this.setLimit("max",e,!1,U.toString(t))}setLimit(e,t,s,r){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:U.toString(r)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:U.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:U.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Y.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}};Ir.create=a=>new Ir({checks:[],typeName:W.ZodNumber,coerce:a?.coerce||!1,...Q(a)});var $r=class a extends K{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==k.bigint)return this._getInvalidInput(e);let s,r=new be;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),D(s,{code:w.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),D(s,{code:w.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),D(s,{code:w.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):Y.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return D(t,{code:w.invalid_type,expected:k.bigint,received:t.parsedType}),z}gte(e,t){return this.setLimit("min",e,!0,U.toString(t))}gt(e,t){return this.setLimit("min",e,!1,U.toString(t))}lte(e,t){return this.setLimit("max",e,!0,U.toString(t))}lt(e,t){return this.setLimit("max",e,!1,U.toString(t))}setLimit(e,t,s,r){return new a({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:U.toString(r)}]})}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};$r.create=a=>new $r({checks:[],typeName:W.ZodBigInt,coerce:a?.coerce??!1,...Q(a)});var Ar=class extends K{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==k.boolean){let s=this._getOrReturnCtx(e);return D(s,{code:w.invalid_type,expected:k.boolean,received:s.parsedType}),z}return we(e.data)}};Ar.create=a=>new Ar({typeName:W.ZodBoolean,coerce:a?.coerce||!1,...Q(a)});var Cr=class a extends K{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){let n=this._getOrReturnCtx(e);return D(n,{code:w.invalid_type,expected:k.date,received:n.parsedType}),z}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return D(n,{code:w.invalid_date}),z}let s=new be,r;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:w.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),s.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:w.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),s.dirty()):Y.assertNever(n);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new a({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:U.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:U.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};Cr.create=a=>new Cr({checks:[],coerce:a?.coerce||!1,typeName:W.ZodDate,...Q(a)});var tt=class extends K{_parse(e){if(this._getType(e)!==k.symbol){let s=this._getOrReturnCtx(e);return D(s,{code:w.invalid_type,expected:k.symbol,received:s.parsedType}),z}return we(e.data)}};tt.create=a=>new tt({typeName:W.ZodSymbol,...Q(a)});var Dr=class extends K{_parse(e){if(this._getType(e)!==k.undefined){let s=this._getOrReturnCtx(e);return D(s,{code:w.invalid_type,expected:k.undefined,received:s.parsedType}),z}return we(e.data)}};Dr.create=a=>new Dr({typeName:W.ZodUndefined,...Q(a)});var kr=class extends K{_parse(e){if(this._getType(e)!==k.null){let s=this._getOrReturnCtx(e);return D(s,{code:w.invalid_type,expected:k.null,received:s.parsedType}),z}return we(e.data)}};kr.create=a=>new kr({typeName:W.ZodNull,...Q(a)});var gr=class extends K{constructor(){super(...arguments),this._any=!0}_parse(e){return we(e.data)}};gr.create=a=>new gr({typeName:W.ZodAny,...Q(a)});var dr=class extends K{constructor(){super(...arguments),this._unknown=!0}_parse(e){return we(e.data)}};dr.create=a=>new dr({typeName:W.ZodUnknown,...Q(a)});var Qe=class extends K{_parse(e){let t=this._getOrReturnCtx(e);return D(t,{code:w.invalid_type,expected:k.never,received:t.parsedType}),z}};Qe.create=a=>new Qe({typeName:W.ZodNever,...Q(a)});var at=class extends K{_parse(e){if(this._getType(e)!==k.undefined){let s=this._getOrReturnCtx(e);return D(s,{code:w.invalid_type,expected:k.void,received:s.parsedType}),z}return we(e.data)}};at.create=a=>new at({typeName:W.ZodVoid,...Q(a)});var fr=class a extends K{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==k.array)return D(t,{code:w.invalid_type,expected:k.array,received:t.parsedType}),z;if(r.exactLength!==null){let l=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(l||i)&&(D(t,{code:l?w.too_big:w.too_small,minimum:i?r.exactLength.value:void 0,maximum:l?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(D(t,{code:w.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(D(t,{code:w.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((l,i)=>r.type._parseAsync(new Ue(t,l,t.path,i)))).then(l=>be.mergeArray(s,l));let n=[...t.data].map((l,i)=>r.type._parseSync(new Ue(t,l,t.path,i)));return be.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new a({...this._def,minLength:{value:e,message:U.toString(t)}})}max(e,t){return new a({...this._def,maxLength:{value:e,message:U.toString(t)}})}length(e,t){return new a({...this._def,exactLength:{value:e,message:U.toString(t)}})}nonempty(e){return this.min(1,e)}};fr.create=(a,e)=>new fr({type:a,minLength:null,maxLength:null,exactLength:null,typeName:W.ZodArray,...Q(e)});function rt(a){if(a instanceof Ce){let e={};for(let t in a.shape){let s=a.shape[t];e[t]=qe.create(rt(s))}return new Ce({...a._def,shape:()=>e})}else return a instanceof fr?new fr({...a._def,type:rt(a.element)}):a instanceof qe?qe.create(rt(a.unwrap())):a instanceof rr?rr.create(rt(a.unwrap())):a instanceof er?er.create(a.items.map(e=>rt(e))):a}var Ce=class a extends K{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Y.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==k.object){let d=this._getOrReturnCtx(e);return D(d,{code:w.invalid_type,expected:k.object,received:d.parsedType}),z}let{status:s,ctx:r}=this._processInputParams(e),{shape:n,keys:l}=this._getCached(),i=[];if(!(this._def.catchall instanceof Qe&&this._def.unknownKeys==="strip"))for(let d in r.data)l.includes(d)||i.push(d);let f=[];for(let d of l){let h=n[d],m=r.data[d];f.push({key:{status:"valid",value:d},value:h._parse(new Ue(r,m,r.path,d)),alwaysSet:d in r.data})}if(this._def.catchall instanceof Qe){let d=this._def.unknownKeys;if(d==="passthrough")for(let h of i)f.push({key:{status:"valid",value:h},value:{status:"valid",value:r.data[h]}});else if(d==="strict")i.length>0&&(D(r,{code:w.unrecognized_keys,keys:i}),s.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let h of i){let m=r.data[h];f.push({key:{status:"valid",value:h},value:d._parse(new Ue(r,m,r.path,h)),alwaysSet:h in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let d=[];for(let h of f){let m=await h.key,E=await h.value;d.push({key:m,value:E,alwaysSet:h.alwaysSet})}return d}).then(d=>be.mergeObjectSync(s,d)):be.mergeObjectSync(s,f)}get shape(){return this._def.shape()}strict(e){return U.errToObj,new a({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{let r=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:U.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new a({...this._def,unknownKeys:"strip"})}passthrough(){return new a({...this._def,unknownKeys:"passthrough"})}extend(e){return new a({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new a({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:W.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new a({...this._def,catchall:e})}pick(e){let t={};for(let s of Y.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new a({...this._def,shape:()=>t})}omit(e){let t={};for(let s of Y.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new a({...this._def,shape:()=>t})}deepPartial(){return rt(this)}partial(e){let t={};for(let s of Y.objectKeys(this.shape)){let r=this.shape[s];e&&!e[s]?t[s]=r:t[s]=r.optional()}return new a({...this._def,shape:()=>t})}required(e){let t={};for(let s of Y.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof qe;)n=n._def.innerType;t[s]=n}return new a({...this._def,shape:()=>t})}keyof(){return ks(Y.objectKeys(this.shape))}};Ce.create=(a,e)=>new Ce({shape:()=>a,unknownKeys:"strip",catchall:Qe.create(),typeName:W.ZodObject,...Q(e)});Ce.strictCreate=(a,e)=>new Ce({shape:()=>a,unknownKeys:"strict",catchall:Qe.create(),typeName:W.ZodObject,...Q(e)});Ce.lazycreate=(a,e)=>new Ce({shape:a,unknownKeys:"strip",catchall:Qe.create(),typeName:W.ZodObject,...Q(e)});var Nr=class extends K{_parse(e){let{ctx:t}=this._processInputParams(e),s=this._def.options;function r(n){for(let i of n)if(i.result.status==="valid")return i.result;for(let i of n)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let l=n.map(i=>new Ae(i.ctx.common.issues));return D(t,{code:w.invalid_union,unionErrors:l}),z}if(t.common.async)return Promise.all(s.map(async n=>{let l={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(r);{let n,l=[];for(let f of s){let d={...t,common:{...t.common,issues:[]},parent:null},h=f._parseSync({data:t.data,path:t.path,parent:d});if(h.status==="valid")return h;h.status==="dirty"&&!n&&(n={result:h,ctx:d}),d.common.issues.length&&l.push(d.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;let i=l.map(f=>new Ae(f));return D(t,{code:w.invalid_union,unionErrors:i}),z}}get options(){return this._def.options}};Nr.create=(a,e)=>new Nr({options:a,typeName:W.ZodUnion,...Q(e)});var ur=a=>a instanceof Lr?ur(a.schema):a instanceof Ve?ur(a.innerType()):a instanceof Fr?[a.value]:a instanceof Mr?a.options:a instanceof qr?Y.objectValues(a.enum):a instanceof Ur?ur(a._def.innerType):a instanceof Dr?[void 0]:a instanceof kr?[null]:a instanceof qe?[void 0,...ur(a.unwrap())]:a instanceof rr?[null,...ur(a.unwrap())]:a instanceof gt||a instanceof Hr?ur(a.unwrap()):a instanceof Vr?ur(a._def.innerType):[],Ct=class a extends K{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==k.object)return D(t,{code:w.invalid_type,expected:k.object,received:t.parsedType}),z;let s=this.discriminator,r=t.data[s],n=this.optionsMap.get(r);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(D(t,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),z)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){let r=new Map;for(let n of t){let l=ur(n.shape[e]);if(!l.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of l){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new a({typeName:W.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Q(s)})}};function Pa(a,e){let t=Xe(a),s=Xe(e);if(a===e)return{valid:!0,data:a};if(t===k.object&&s===k.object){let r=Y.objectKeys(e),n=Y.objectKeys(a).filter(i=>r.indexOf(i)!==-1),l={...a,...e};for(let i of n){let f=Pa(a[i],e[i]);if(!f.valid)return{valid:!1};l[i]=f.data}return{valid:!0,data:l}}else if(t===k.array&&s===k.array){if(a.length!==e.length)return{valid:!1};let r=[];for(let n=0;n<a.length;n++){let l=a[n],i=e[n],f=Pa(l,i);if(!f.valid)return{valid:!1};r.push(f.data)}return{valid:!0,data:r}}else return t===k.date&&s===k.date&&+a==+e?{valid:!0,data:a}:{valid:!1}}var jr=class extends K{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),r=(n,l)=>{if($t(n)||$t(l))return z;let i=Pa(n.value,l.value);return i.valid?((At(n)||At(l))&&t.dirty(),{status:t.value,value:i.data}):(D(s,{code:w.invalid_intersection_types}),z)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([n,l])=>r(n,l)):r(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};jr.create=(a,e,t)=>new jr({left:a,right:e,typeName:W.ZodIntersection,...Q(t)});var er=class a extends K{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.array)return D(s,{code:w.invalid_type,expected:k.array,received:s.parsedType}),z;if(s.data.length<this._def.items.length)return D(s,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),z;!this._def.rest&&s.data.length>this._def.items.length&&(D(s,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...s.data].map((l,i)=>{let f=this._def.items[i]||this._def.rest;return f?f._parse(new Ue(s,l,s.path,i)):null}).filter(l=>!!l);return s.common.async?Promise.all(n).then(l=>be.mergeArray(t,l)):be.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new a({...this._def,rest:e})}};er.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new er({items:a,typeName:W.ZodTuple,rest:null,...Q(e)})};var Dt=class a extends K{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.object)return D(s,{code:w.invalid_type,expected:k.object,received:s.parsedType}),z;let r=[],n=this._def.keyType,l=this._def.valueType;for(let i in s.data)r.push({key:n._parse(new Ue(s,i,s.path,i)),value:l._parse(new Ue(s,s.data[i],s.path,i)),alwaysSet:i in s.data});return s.common.async?be.mergeObjectAsync(t,r):be.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof K?new a({keyType:e,valueType:t,typeName:W.ZodRecord,...Q(s)}):new a({keyType:vr.create(),valueType:e,typeName:W.ZodRecord,...Q(t)})}},st=class extends K{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.map)return D(s,{code:w.invalid_type,expected:k.map,received:s.parsedType}),z;let r=this._def.keyType,n=this._def.valueType,l=[...s.data.entries()].map(([i,f],d)=>({key:r._parse(new Ue(s,i,s.path,[d,"key"])),value:n._parse(new Ue(s,f,s.path,[d,"value"]))}));if(s.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let f of l){let d=await f.key,h=await f.value;if(d.status==="aborted"||h.status==="aborted")return z;(d.status==="dirty"||h.status==="dirty")&&t.dirty(),i.set(d.value,h.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let f of l){let d=f.key,h=f.value;if(d.status==="aborted"||h.status==="aborted")return z;(d.status==="dirty"||h.status==="dirty")&&t.dirty(),i.set(d.value,h.value)}return{status:t.value,value:i}}}};st.create=(a,e,t)=>new st({valueType:e,keyType:a,typeName:W.ZodMap,...Q(t)});var nt=class a extends K{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.set)return D(s,{code:w.invalid_type,expected:k.set,received:s.parsedType}),z;let r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&(D(s,{code:w.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&s.data.size>r.maxSize.value&&(D(s,{code:w.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let n=this._def.valueType;function l(f){let d=new Set;for(let h of f){if(h.status==="aborted")return z;h.status==="dirty"&&t.dirty(),d.add(h.value)}return{status:t.value,value:d}}let i=[...s.data.values()].map((f,d)=>n._parse(new Ue(s,f,s.path,d)));return s.common.async?Promise.all(i).then(f=>l(f)):l(i)}min(e,t){return new a({...this._def,minSize:{value:e,message:U.toString(t)}})}max(e,t){return new a({...this._def,maxSize:{value:e,message:U.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};nt.create=(a,e)=>new nt({valueType:a,minSize:null,maxSize:null,typeName:W.ZodSet,...Q(e)});var kt=class a extends K{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==k.function)return D(t,{code:w.invalid_type,expected:k.function,received:t.parsedType}),z;function s(i,f){return vt({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Xr(),cr].filter(d=>!!d),issueData:{code:w.invalid_arguments,argumentsError:f}})}function r(i,f){return vt({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Xr(),cr].filter(d=>!!d),issueData:{code:w.invalid_return_type,returnTypeError:f}})}let n={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof yr){let i=this;return we(async function(...f){let d=new Ae([]),h=await i._def.args.parseAsync(f,n).catch(c=>{throw d.addIssue(s(f,c)),d}),m=await Reflect.apply(l,this,h);return await i._def.returns._def.type.parseAsync(m,n).catch(c=>{throw d.addIssue(r(m,c)),d})})}else{let i=this;return we(function(...f){let d=i._def.args.safeParse(f,n);if(!d.success)throw new Ae([s(f,d.error)]);let h=Reflect.apply(l,this,d.data),m=i._def.returns.safeParse(h,n);if(!m.success)throw new Ae([r(h,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new a({...this._def,args:er.create(e).rest(dr.create())})}returns(e){return new a({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new a({args:e||er.create([]).rest(dr.create()),returns:t||dr.create(),typeName:W.ZodFunction,...Q(s)})}},Lr=class extends K{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Lr.create=(a,e)=>new Lr({getter:a,typeName:W.ZodLazy,...Q(e)});var Fr=class extends K{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return D(t,{received:t.data,code:w.invalid_literal,expected:this._def.value}),z}return{status:"valid",value:e.data}}get value(){return this._def.value}};Fr.create=(a,e)=>new Fr({value:a,typeName:W.ZodLiteral,...Q(e)});function ks(a,e){return new Mr({values:a,typeName:W.ZodEnum,...Q(e)})}var Mr=class a extends K{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return D(t,{expected:Y.joinValues(s),received:t.parsedType,code:w.invalid_type}),z}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),s=this._def.values;return D(t,{received:t.data,code:w.invalid_enum_value,options:s}),z}return we(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return a.create(e,{...this._def,...t})}exclude(e,t=this._def){return a.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}};Mr.create=ks;var qr=class extends K{_parse(e){let t=Y.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==k.string&&s.parsedType!==k.number){let r=Y.objectValues(t);return D(s,{expected:Y.joinValues(r),received:s.parsedType,code:w.invalid_type}),z}if(this._cache||(this._cache=new Set(Y.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=Y.objectValues(t);return D(s,{received:s.data,code:w.invalid_enum_value,options:r}),z}return we(e.data)}get enum(){return this._def.values}};qr.create=(a,e)=>new qr({values:a,typeName:W.ZodNativeEnum,...Q(e)});var yr=class extends K{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==k.promise&&t.common.async===!1)return D(t,{code:w.invalid_type,expected:k.promise,received:t.parsedType}),z;let s=t.parsedType===k.promise?t.data:Promise.resolve(t.data);return we(s.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};yr.create=(a,e)=>new yr({type:a,typeName:W.ZodPromise,...Q(e)});var Ve=class extends K{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===W.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:s}=this._processInputParams(e),r=this._def.effect||null,n={addIssue:l=>{D(s,l),l.fatal?t.abort():t.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),r.type==="preprocess"){let l=r.transform(s.data,n);if(s.common.async)return Promise.resolve(l).then(async i=>{if(t.value==="aborted")return z;let f=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return f.status==="aborted"?z:f.status==="dirty"?Or(f.value):t.value==="dirty"?Or(f.value):f});{if(t.value==="aborted")return z;let i=this._def.schema._parseSync({data:l,path:s.path,parent:s});return i.status==="aborted"?z:i.status==="dirty"?Or(i.value):t.value==="dirty"?Or(i.value):i}}if(r.type==="refinement"){let l=i=>{let f=r.refinement(i,n);if(s.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(s.common.async===!1){let i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?z:(i.status==="dirty"&&t.dirty(),l(i.value),{status:t.value,value:i.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>i.status==="aborted"?z:(i.status==="dirty"&&t.dirty(),l(i.value).then(()=>({status:t.value,value:i.value}))))}if(r.type==="transform")if(s.common.async===!1){let l=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!mr(l))return z;let i=r.transform(l.value,n);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(l=>mr(l)?Promise.resolve(r.transform(l.value,n)).then(i=>({status:t.value,value:i})):z);Y.assertNever(r)}};Ve.create=(a,e,t)=>new Ve({schema:a,typeName:W.ZodEffects,effect:e,...Q(t)});Ve.createWithPreprocess=(a,e,t)=>new Ve({schema:e,effect:{type:"preprocess",transform:a},typeName:W.ZodEffects,...Q(t)});var qe=class extends K{_parse(e){return this._getType(e)===k.undefined?we(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};qe.create=(a,e)=>new qe({innerType:a,typeName:W.ZodOptional,...Q(e)});var rr=class extends K{_parse(e){return this._getType(e)===k.null?we(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};rr.create=(a,e)=>new rr({innerType:a,typeName:W.ZodNullable,...Q(e)});var Ur=class extends K{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return t.parsedType===k.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Ur.create=(a,e)=>new Ur({innerType:a,typeName:W.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Q(e)});var Vr=class extends K{_parse(e){let{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return et(r)?r.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Ae(s.common.issues)},input:s.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Ae(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};Vr.create=(a,e)=>new Vr({innerType:a,typeName:W.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Q(e)});var it=class extends K{_parse(e){if(this._getType(e)!==k.nan){let s=this._getOrReturnCtx(e);return D(s,{code:w.invalid_type,expected:k.nan,received:s.parsedType}),z}return{status:"valid",value:e.data}}};it.create=a=>new it({typeName:W.ZodNaN,...Q(a)});var _l=Symbol("zod_brand"),gt=class extends K{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}},yt=class a extends K{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?z:n.status==="dirty"?(t.dirty(),Or(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{let r=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?z:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:s.path,parent:s})}}static create(e,t){return new a({in:e,out:t,typeName:W.ZodPipeline})}},Hr=class extends K{_parse(e){let t=this._def.innerType._parse(e),s=r=>(mr(r)&&(r.value=Object.freeze(r.value)),r);return et(t)?t.then(r=>s(r)):s(t)}unwrap(){return this._def.innerType}};Hr.create=(a,e)=>new Hr({innerType:a,typeName:W.ZodReadonly,...Q(e)});function $s(a,e){let t=typeof a=="function"?a(e):typeof a=="string"?{message:a}:a;return typeof t=="string"?{message:t}:t}function Ns(a,e={},t){return a?gr.create().superRefine((s,r)=>{let n=a(s);if(n instanceof Promise)return n.then(l=>{if(!l){let i=$s(e,s),f=i.fatal??t??!0;r.addIssue({code:"custom",...i,fatal:f})}});if(!n){let l=$s(e,s),i=l.fatal??t??!0;r.addIssue({code:"custom",...l,fatal:i})}}):gr.create()}var El={object:Ce.lazycreate},W;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(W||(W={}));var Sl=(a,e={message:`Input not instance of ${a.name}`})=>Ns(t=>t instanceof a,e),js=vr.create,Ls=Ir.create,bl=it.create,Pl=$r.create,Fs=Ar.create,xl=Cr.create,wl=tt.create,Rl=Dr.create,Tl=kr.create,Ol=gr.create,Il=dr.create,$l=Qe.create,Al=at.create,Cl=fr.create,Dl=Ce.create,kl=Ce.strictCreate,Nl=Nr.create,jl=Ct.create,Ll=jr.create,Fl=er.create,Ml=Dt.create,ql=st.create,Ul=nt.create,Vl=kt.create,Hl=Lr.create,zl=Fr.create,Wl=Mr.create,Bl=qr.create,Ql=yr.create,Zl=Ve.create,Kl=qe.create,Gl=rr.create,Jl=Ve.createWithPreprocess,Yl=yt.create,Xl=()=>js().optional(),ec=()=>Ls().optional(),rc=()=>Fs().optional(),tc={string:(a=>vr.create({...a,coerce:!0})),number:(a=>Ir.create({...a,coerce:!0})),boolean:(a=>Ar.create({...a,coerce:!0})),bigint:(a=>$r.create({...a,coerce:!0})),date:(a=>Cr.create({...a,coerce:!0}))};var ac=z;var xa="2025-06-18";var Ms=[xa,"2025-03-26","2024-11-05","2024-10-07"],Nt="2.0",qs=o.union([o.string(),o.number().int()]),Us=o.string(),sc=o.object({progressToken:o.optional(qs)}).passthrough(),He=o.object({_meta:o.optional(sc)}).passthrough(),De=o.object({method:o.string(),params:o.optional(He)}),_t=o.object({_meta:o.optional(o.object({}).passthrough())}).passthrough(),tr=o.object({method:o.string(),params:o.optional(_t)}),ze=o.object({_meta:o.optional(o.object({}).passthrough())}).passthrough(),jt=o.union([o.string(),o.number().int()]),Vs=o.object({jsonrpc:o.literal(Nt),id:jt}).merge(De).strict(),Hs=a=>Vs.safeParse(a).success,zs=o.object({jsonrpc:o.literal(Nt)}).merge(tr).strict(),Ws=a=>zs.safeParse(a).success,Bs=o.object({jsonrpc:o.literal(Nt),id:jt,result:ze}).strict(),wa=a=>Bs.safeParse(a).success,Ze;(function(a){a[a.ConnectionClosed=-32e3]="ConnectionClosed",a[a.RequestTimeout=-32001]="RequestTimeout",a[a.ParseError=-32700]="ParseError",a[a.InvalidRequest=-32600]="InvalidRequest",a[a.MethodNotFound=-32601]="MethodNotFound",a[a.InvalidParams=-32602]="InvalidParams",a[a.InternalError=-32603]="InternalError"})(Ze||(Ze={}));var Qs=o.object({jsonrpc:o.literal(Nt),id:jt,error:o.object({code:o.number().int(),message:o.string(),data:o.optional(o.unknown())})}).strict(),Zs=a=>Qs.safeParse(a).success,Ks=o.union([Vs,zs,Bs,Qs]),Lt=ze.strict(),Ft=tr.extend({method:o.literal("notifications/cancelled"),params:_t.extend({requestId:jt,reason:o.string().optional()})}),nc=o.object({src:o.string(),mimeType:o.optional(o.string()),sizes:o.optional(o.array(o.string()))}).passthrough(),Et=o.object({icons:o.array(nc).optional()}).passthrough(),St=o.object({name:o.string(),title:o.optional(o.string())}).passthrough(),Gs=St.extend({version:o.string(),websiteUrl:o.optional(o.string())}).merge(Et),ic=o.object({experimental:o.optional(o.object({}).passthrough()),sampling:o.optional(o.object({}).passthrough()),elicitation:o.optional(o.object({}).passthrough()),roots:o.optional(o.object({listChanged:o.optional(o.boolean())}).passthrough())}).passthrough(),Ra=De.extend({method:o.literal("initialize"),params:He.extend({protocolVersion:o.string(),capabilities:ic,clientInfo:Gs})});var oc=o.object({experimental:o.optional(o.object({}).passthrough()),logging:o.optional(o.object({}).passthrough()),completions:o.optional(o.object({}).passthrough()),prompts:o.optional(o.object({listChanged:o.optional(o.boolean())}).passthrough()),resources:o.optional(o.object({subscribe:o.optional(o.boolean()),listChanged:o.optional(o.boolean())}).passthrough()),tools:o.optional(o.object({listChanged:o.optional(o.boolean())}).passthrough())}).passthrough(),lc=ze.extend({protocolVersion:o.string(),capabilities:oc,serverInfo:Gs,instructions:o.optional(o.string())}),Ta=tr.extend({method:o.literal("notifications/initialized")});var Mt=De.extend({method:o.literal("ping")}),cc=o.object({progress:o.number(),total:o.optional(o.number()),message:o.optional(o.string())}).passthrough(),qt=tr.extend({method:o.literal("notifications/progress"),params:_t.merge(cc).extend({progressToken:qs})}),Ut=De.extend({params:He.extend({cursor:o.optional(Us)}).optional()}),Vt=ze.extend({nextCursor:o.optional(Us)}),Js=o.object({uri:o.string(),mimeType:o.optional(o.string()),_meta:o.optional(o.object({}).passthrough())}).passthrough(),Ys=Js.extend({text:o.string()}),Oa=o.string().refine(a=>{try{return atob(a),!0}catch{return!1}},{message:"Invalid Base64 string"}),Xs=Js.extend({blob:Oa}),en=St.extend({uri:o.string(),description:o.optional(o.string()),mimeType:o.optional(o.string()),_meta:o.optional(o.object({}).passthrough())}).merge(Et),uc=St.extend({uriTemplate:o.string(),description:o.optional(o.string()),mimeType:o.optional(o.string()),_meta:o.optional(o.object({}).passthrough())}).merge(Et),dc=Ut.extend({method:o.literal("resources/list")}),fc=Vt.extend({resources:o.array(en)}),hc=Ut.extend({method:o.literal("resources/templates/list")}),pc=Vt.extend({resourceTemplates:o.array(uc)}),mc=De.extend({method:o.literal("resources/read"),params:He.extend({uri:o.string()})}),vc=ze.extend({contents:o.array(o.union([Ys,Xs]))}),gc=tr.extend({method:o.literal("notifications/resources/list_changed")}),yc=De.extend({method:o.literal("resources/subscribe"),params:He.extend({uri:o.string()})}),_c=De.extend({method:o.literal("resources/unsubscribe"),params:He.extend({uri:o.string()})}),Ec=tr.extend({method:o.literal("notifications/resources/updated"),params:_t.extend({uri:o.string()})}),Sc=o.object({name:o.string(),description:o.optional(o.string()),required:o.optional(o.boolean())}).passthrough(),bc=St.extend({description:o.optional(o.string()),arguments:o.optional(o.array(Sc)),_meta:o.optional(o.object({}).passthrough())}).merge(Et),Pc=Ut.extend({method:o.literal("prompts/list")}),xc=Vt.extend({prompts:o.array(bc)}),wc=De.extend({method:o.literal("prompts/get"),params:He.extend({name:o.string(),arguments:o.optional(o.record(o.string()))})}),Ia=o.object({type:o.literal("text"),text:o.string(),_meta:o.optional(o.object({}).passthrough())}).passthrough(),$a=o.object({type:o.literal("image"),data:Oa,mimeType:o.string(),_meta:o.optional(o.object({}).passthrough())}).passthrough(),Aa=o.object({type:o.literal("audio"),data:Oa,mimeType:o.string(),_meta:o.optional(o.object({}).passthrough())}).passthrough(),Rc=o.object({type:o.literal("resource"),resource:o.union([Ys,Xs]),_meta:o.optional(o.object({}).passthrough())}).passthrough(),Tc=en.extend({type:o.literal("resource_link")}),rn=o.union([Ia,$a,Aa,Tc,Rc]),Oc=o.object({role:o.enum(["user","assistant"]),content:rn}).passthrough(),Ic=ze.extend({description:o.optional(o.string()),messages:o.array(Oc)}),$c=tr.extend({method:o.literal("notifications/prompts/list_changed")}),Ac=o.object({title:o.optional(o.string()),readOnlyHint:o.optional(o.boolean()),destructiveHint:o.optional(o.boolean()),idempotentHint:o.optional(o.boolean()),openWorldHint:o.optional(o.boolean())}).passthrough(),Cc=St.extend({description:o.optional(o.string()),inputSchema:o.object({type:o.literal("object"),properties:o.optional(o.object({}).passthrough()),required:o.optional(o.array(o.string()))}).passthrough(),outputSchema:o.optional(o.object({type:o.literal("object"),properties:o.optional(o.object({}).passthrough()),required:o.optional(o.array(o.string()))}).passthrough()),annotations:o.optional(Ac),_meta:o.optional(o.object({}).passthrough())}).merge(Et),Ca=Ut.extend({method:o.literal("tools/list")}),Dc=Vt.extend({tools:o.array(Cc)}),tn=ze.extend({content:o.array(rn).default([]),structuredContent:o.object({}).passthrough().optional(),isError:o.optional(o.boolean())}),wf=tn.or(ze.extend({toolResult:o.unknown()})),Da=De.extend({method:o.literal("tools/call"),params:He.extend({name:o.string(),arguments:o.optional(o.record(o.unknown()))})}),kc=tr.extend({method:o.literal("notifications/tools/list_changed")}),bt=o.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),ka=De.extend({method:o.literal("logging/setLevel"),params:He.extend({level:bt})}),Nc=tr.extend({method:o.literal("notifications/message"),params:_t.extend({level:bt,logger:o.optional(o.string()),data:o.unknown()})}),jc=o.object({name:o.string().optional()}).passthrough(),Lc=o.object({hints:o.optional(o.array(jc)),costPriority:o.optional(o.number().min(0).max(1)),speedPriority:o.optional(o.number().min(0).max(1)),intelligencePriority:o.optional(o.number().min(0).max(1))}).passthrough(),Fc=o.object({role:o.enum(["user","assistant"]),content:o.union([Ia,$a,Aa])}).passthrough(),Mc=De.extend({method:o.literal("sampling/createMessage"),params:He.extend({messages:o.array(Fc),systemPrompt:o.optional(o.string()),includeContext:o.optional(o.enum(["none","thisServer","allServers"])),temperature:o.optional(o.number()),maxTokens:o.number().int(),stopSequences:o.optional(o.array(o.string())),metadata:o.optional(o.object({}).passthrough()),modelPreferences:o.optional(Lc)})}),Na=ze.extend({model:o.string(),stopReason:o.optional(o.enum(["endTurn","stopSequence","maxTokens"]).or(o.string())),role:o.enum(["user","assistant"]),content:o.discriminatedUnion("type",[Ia,$a,Aa])}),qc=o.object({type:o.literal("boolean"),title:o.optional(o.string()),description:o.optional(o.string()),default:o.optional(o.boolean())}).passthrough(),Uc=o.object({type:o.literal("string"),title:o.optional(o.string()),description:o.optional(o.string()),minLength:o.optional(o.number()),maxLength:o.optional(o.number()),format:o.optional(o.enum(["email","uri","date","date-time"]))}).passthrough(),Vc=o.object({type:o.enum(["number","integer"]),title:o.optional(o.string()),description:o.optional(o.string()),minimum:o.optional(o.number()),maximum:o.optional(o.number())}).passthrough(),Hc=o.object({type:o.literal("string"),title:o.optional(o.string()),description:o.optional(o.string()),enum:o.array(o.string()),enumNames:o.optional(o.array(o.string()))}).passthrough(),zc=o.union([qc,Uc,Vc,Hc]),Wc=De.extend({method:o.literal("elicitation/create"),params:He.extend({message:o.string(),requestedSchema:o.object({type:o.literal("object"),properties:o.record(o.string(),zc),required:o.optional(o.array(o.string()))}).passthrough()})}),ja=ze.extend({action:o.enum(["accept","decline","cancel"]),content:o.optional(o.record(o.string(),o.unknown()))}),Bc=o.object({type:o.literal("ref/resource"),uri:o.string()}).passthrough();var Qc=o.object({type:o.literal("ref/prompt"),name:o.string()}).passthrough(),Zc=De.extend({method:o.literal("completion/complete"),params:He.extend({ref:o.union([Qc,Bc]),argument:o.object({name:o.string(),value:o.string()}).passthrough(),context:o.optional(o.object({arguments:o.optional(o.record(o.string(),o.string()))}))})}),Kc=ze.extend({completion:o.object({values:o.array(o.string()).max(100),total:o.optional(o.number().int()),hasMore:o.optional(o.boolean())}).passthrough()}),Gc=o.object({uri:o.string().startsWith("file://"),name:o.optional(o.string()),_meta:o.optional(o.object({}).passthrough())}).passthrough(),Jc=De.extend({method:o.literal("roots/list")}),La=ze.extend({roots:o.array(Gc)}),Yc=tr.extend({method:o.literal("notifications/roots/list_changed")}),Rf=o.union([Mt,Ra,Zc,ka,wc,Pc,dc,hc,mc,yc,_c,Da,Ca]),Tf=o.union([Ft,qt,Ta,Yc]),Of=o.union([Lt,Na,ja,La]),If=o.union([Mt,Mc,Wc,Jc]),$f=o.union([Ft,qt,Nc,Ec,gc,kc,$c]),Af=o.union([Lt,lc,Kc,Ic,xc,fc,pc,vc,tn,Dc]),Ke=class extends Error{constructor(e,t,s){super(`MCP error ${e}: ${t}`),this.code=e,this.data=s,this.name="McpError"}};var Xc=6e4,Ht=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(Ft,t=>{let s=this._requestHandlerAbortControllers.get(t.params.requestId);s?.abort(t.params.reason)}),this.setNotificationHandler(qt,t=>{this._onprogress(t)}),this.setRequestHandler(Mt,t=>({}))}_setupTimeout(e,t,s,r,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:n,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Ke(Ze.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var t,s,r;this._transport=e;let n=(t=this.transport)===null||t===void 0?void 0:t.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};let l=(s=this.transport)===null||s===void 0?void 0:s.onerror;this._transport.onerror=f=>{l?.(f),this._onerror(f)};let i=(r=this._transport)===null||r===void 0?void 0:r.onmessage;this._transport.onmessage=(f,d)=>{i?.(f,d),wa(f)||Zs(f)?this._onresponse(f):Hs(f)?this._onrequest(f,d):Ws(f)?this._onnotification(f):this._onerror(new Error(`Unknown message type: ${JSON.stringify(f)}`))},await this._transport.start()}_onclose(){var e;let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);let s=new Ke(Ze.ConnectionClosed,"Connection closed");for(let r of t.values())r(s)}_onerror(e){var t;(t=this.onerror)===null||t===void 0||t.call(this,e)}_onnotification(e){var t;let s=(t=this._notificationHandlers.get(e.method))!==null&&t!==void 0?t:this.fallbackNotificationHandler;s!==void 0&&Promise.resolve().then(()=>s(e)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){var s,r;let n=(s=this._requestHandlers.get(e.method))!==null&&s!==void 0?s:this.fallbackRequestHandler,l=this._transport;if(n===void 0){l?.send({jsonrpc:"2.0",id:e.id,error:{code:Ze.MethodNotFound,message:"Method not found"}}).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);let f={signal:i.signal,sessionId:l?.sessionId,_meta:(r=e.params)===null||r===void 0?void 0:r._meta,sendNotification:d=>this.notification(d,{relatedRequestId:e.id}),sendRequest:(d,h,m)=>this.request(d,h,{...m,relatedRequestId:e.id}),authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo};Promise.resolve().then(()=>n(e,f)).then(d=>{if(!i.signal.aborted)return l?.send({result:d,jsonrpc:"2.0",id:e.id})},d=>{var h;if(!i.signal.aborted)return l?.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(d.code)?d.code:Ze.InternalError,message:(h=d.message)!==null&&h!==void 0?h:"Internal error"}})}).catch(d=>this._onerror(new Error(`Failed to send response: ${d}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...s}=e.params,r=Number(t),n=this._progressHandlers.get(r);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let l=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&l&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(f){l(f);return}n(s)}_onresponse(e){let t=Number(e.id),s=this._responseHandlers.get(t);if(s===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._progressHandlers.delete(t),this._cleanupTimeout(t),wa(e))s(e);else{let r=new Ke(e.error.code,e.error.message,e.error.data);s(r)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,t,s){let{relatedRequestId:r,resumptionToken:n,onresumptiontoken:l}=s??{};return new Promise((i,f)=>{var d,h,m,E,c,y;if(!this._transport){f(new Error("Not connected"));return}((d=this._options)===null||d===void 0?void 0:d.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(h=s?.signal)===null||h===void 0||h.throwIfAborted();let _=this._requestMessageId++,v={...e,jsonrpc:"2.0",id:_};s?.onprogress&&(this._progressHandlers.set(_,s.onprogress),v.params={...e.params,_meta:{...((m=e.params)===null||m===void 0?void 0:m._meta)||{},progressToken:_}});let P=R=>{var I;this._responseHandlers.delete(_),this._progressHandlers.delete(_),this._cleanupTimeout(_),(I=this._transport)===null||I===void 0||I.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:_,reason:String(R)}},{relatedRequestId:r,resumptionToken:n,onresumptiontoken:l}).catch($=>this._onerror(new Error(`Failed to send cancellation: ${$}`))),f(R)};this._responseHandlers.set(_,R=>{var I;if(!(!((I=s?.signal)===null||I===void 0)&&I.aborted)){if(R instanceof Error)return f(R);try{let $=t.parse(R.result);i($)}catch($){f($)}}}),(E=s?.signal)===null||E===void 0||E.addEventListener("abort",()=>{var R;P((R=s?.signal)===null||R===void 0?void 0:R.reason)});let T=(c=s?.timeout)!==null&&c!==void 0?c:Xc,x=()=>P(new Ke(Ze.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(_,T,s?.maxTotalTimeout,x,(y=s?.resetTimeoutOnProgress)!==null&&y!==void 0?y:!1),this._transport.send(v,{relatedRequestId:r,resumptionToken:n,onresumptiontoken:l}).catch(R=>{this._cleanupTimeout(_),f(R)})})}async notification(e,t){var s,r;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),((r=(s=this._options)===null||s===void 0?void 0:s.debouncedNotificationMethods)!==null&&r!==void 0?r:[]).includes(e.method)&&!e.params&&!t?.relatedRequestId){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var f;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let d={...e,jsonrpc:"2.0"};(f=this._transport)===null||f===void 0||f.send(d,t).catch(h=>this._onerror(h))});return}let i={...e,jsonrpc:"2.0"};await this._transport.send(i,t)}setRequestHandler(e,t){let s=e.shape.method.value;this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,n)=>Promise.resolve(t(e.parse(r),n)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){this._notificationHandlers.set(e.shape.method.value,s=>Promise.resolve(t(e.parse(s))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function an(a,e){return Object.entries(e).reduce((t,[s,r])=>(r&&typeof r=="object"?t[s]=t[s]?{...t[s],...r}:r:t[s]=r,t),{...a})}var io=Ea(no(),1),la=class extends Ht{constructor(e,t){var s;super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(bt.options.map((r,n)=>[r,n])),this.isMessageIgnored=(r,n)=>{let l=this._loggingLevels.get(n);return l?this.LOG_LEVEL_SEVERITY.get(r)<this.LOG_LEVEL_SEVERITY.get(l):!1},this._capabilities=(s=t?.capabilities)!==null&&s!==void 0?s:{},this._instructions=t?.instructions,this.setRequestHandler(Ra,r=>this._oninitialize(r)),this.setNotificationHandler(Ta,()=>{var r;return(r=this.oninitialized)===null||r===void 0?void 0:r.call(this)}),this._capabilities.logging&&this.setRequestHandler(ka,async(r,n)=>{var l;let i=n.sessionId||((l=n.requestInfo)===null||l===void 0?void 0:l.headers["mcp-session-id"])||void 0,{level:f}=r.params,d=bt.safeParse(f);return d.success&&this._loggingLevels.set(i,d.data),{}})}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=an(this._capabilities,e)}assertCapabilityForMethod(e){var t,s,r;switch(e){case"sampling/createMessage":if(!(!((t=this._clientCapabilities)===null||t===void 0)&&t.sampling))throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!(!((s=this._clientCapabilities)===null||s===void 0)&&s.elicitation))throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!(!((r=this._clientCapabilities)===null||r===void 0)&&r.roots))throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Server does not support sampling (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Ms.includes(t)?t:xa,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Lt)}async createMessage(e,t){return this.request({method:"sampling/createMessage",params:e},Na,t)}async elicitInput(e,t){let s=await this.request({method:"elicitation/create",params:e},ja,t);if(s.action==="accept"&&s.content)try{let r=new io.default,n=r.compile(e.requestedSchema);if(!n(s.content))throw new Ke(Ze.InvalidParams,`Elicitation response content does not match requested schema: ${r.errorsText(n.errors)}`)}catch(r){throw r instanceof Ke?r:new Ke(Ze.InternalError,`Error validating elicitation response: ${r}`)}return s}async listRoots(e,t){return this.request({method:"roots/list",params:e},La,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var ls=Ea(require("node:process"),1);var ca=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
`);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),Cd(t)}clear(){this._buffer=void 0}};function Cd(a){return Ks.parse(JSON.parse(a))}function oo(a){return JSON.stringify(a)+`
|
|
`}var ua=class{constructor(e=ls.default.stdin,t=ls.default.stdout){this._stdin=e,this._stdout=t,this._readBuffer=new ca,this._started=!1,this._ondata=s=>{this._readBuffer.append(s),this.processReadBuffer()},this._onerror=s=>{var r;(r=this.onerror)===null||r===void 0||r.call(this,s)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(var e,t;;)try{let s=this._readBuffer.readMessage();if(s===null)break;(e=this.onmessage)===null||e===void 0||e.call(this,s)}catch(s){(t=this.onerror)===null||t===void 0||t.call(this,s)}}async close(){var e;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),(e=this.onclose)===null||e===void 0||e.call(this)}send(e){return new Promise(t=>{let s=oo(e);this._stdout.write(s)?t():this._stdout.once("drain",t)})}};var ot=require("fs"),uo=require("path"),fo=require("os");var Dd=["bugfix","feature","refactor","discovery","decision","change"],kd=["how-it-works","why-it-exists","what-changed","problem-solution","gotcha","pattern","trade-off"];var lo=Dd.join(","),co=kd.join(",");var We=class{static DEFAULTS={CLAUDE_MEM_MODEL:"claude-sonnet-4-5",CLAUDE_MEM_CONTEXT_OBSERVATIONS:"50",CLAUDE_MEM_WORKER_PORT:"37777",CLAUDE_MEM_WORKER_HOST:"127.0.0.1",CLAUDE_MEM_SKIP_TOOLS:"ListMcpResourcesTool,SlashCommand,Skill,TodoWrite,AskUserQuestion",CLAUDE_MEM_DATA_DIR:(0,uo.join)((0,fo.homedir)(),".claude-mem"),CLAUDE_MEM_LOG_LEVEL:"INFO",CLAUDE_MEM_PYTHON_VERSION:"3.13",CLAUDE_CODE_PATH:"",CLAUDE_MEM_CONTEXT_SHOW_READ_TOKENS:"true",CLAUDE_MEM_CONTEXT_SHOW_WORK_TOKENS:"true",CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_AMOUNT:"true",CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_PERCENT:"true",CLAUDE_MEM_CONTEXT_OBSERVATION_TYPES:lo,CLAUDE_MEM_CONTEXT_OBSERVATION_CONCEPTS:co,CLAUDE_MEM_CONTEXT_FULL_COUNT:"5",CLAUDE_MEM_CONTEXT_FULL_FIELD:"narrative",CLAUDE_MEM_CONTEXT_SESSION_COUNT:"10",CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARY:"true",CLAUDE_MEM_CONTEXT_SHOW_LAST_MESSAGE:"false"};static getAllDefaults(){return{...this.DEFAULTS}}static get(e){return this.DEFAULTS[e]}static getInt(e){let t=this.get(e);return parseInt(t,10)}static getBool(e){return this.get(e)==="true"}static loadFromFile(e){try{if(!(0,ot.existsSync)(e))return this.getAllDefaults();let t=(0,ot.readFileSync)(e,"utf-8"),s=JSON.parse(t),r=s;if(s.env&&typeof s.env=="object"){r=s.env;try{(0,ot.writeFileSync)(e,JSON.stringify(r,null,2),"utf-8"),me.info("SETTINGS","Migrated settings file from nested to flat schema",{settingsPath:e})}catch(l){me.warn("SETTINGS","Failed to auto-migrate settings file",{settingsPath:e},l)}}let n={...this.DEFAULTS};for(let l of Object.keys(this.DEFAULTS))r[l]!==void 0&&(n[l]=r[l]);return n}catch(t){return me.warn("SETTINGS","Failed to load settings, using defaults",{settingsPath:e},t),this.getAllDefaults()}}};var cs=(n=>(n[n.DEBUG=0]="DEBUG",n[n.INFO=1]="INFO",n[n.WARN=2]="WARN",n[n.ERROR=3]="ERROR",n[n.SILENT=4]="SILENT",n))(cs||{}),us=class{level=null;useColor;constructor(){this.useColor=process.stdout.isTTY??!1}getLevel(){if(this.level===null){let e=We.get("CLAUDE_MEM_LOG_LEVEL").toUpperCase();this.level=cs[e]??1}return this.level}correlationId(e,t){return`obs-${e}-${t}`}sessionId(e){return`session-${e}`}formatData(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return e.toString();if(typeof e=="object"){if(e instanceof Error)return this.getLevel()===0?`${e.message}
|
|
${e.stack}`:e.message;if(Array.isArray(e))return`[${e.length} items]`;let t=Object.keys(e);return t.length===0?"{}":t.length<=3?JSON.stringify(e):`{${t.length} keys: ${t.slice(0,3).join(", ")}...}`}return String(e)}formatTool(e,t){if(!t)return e;try{let s=typeof t=="string"?JSON.parse(t):t;if(e==="Bash"&&s.command)return`${e}(${s.command})`;if(s.file_path)return`${e}(${s.file_path})`;if(s.notebook_path)return`${e}(${s.notebook_path})`;if(e==="Glob"&&s.pattern)return`${e}(${s.pattern})`;if(e==="Grep"&&s.pattern)return`${e}(${s.pattern})`;if(s.url)return`${e}(${s.url})`;if(s.query)return`${e}(${s.query})`;if(e==="Task"){if(s.subagent_type)return`${e}(${s.subagent_type})`;if(s.description)return`${e}(${s.description})`}return e==="Skill"&&s.skill?`${e}(${s.skill})`:e==="LSP"&&s.operation?`${e}(${s.operation})`:e}catch{return e}}formatTimestamp(e){let t=e.getFullYear(),s=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),n=String(e.getHours()).padStart(2,"0"),l=String(e.getMinutes()).padStart(2,"0"),i=String(e.getSeconds()).padStart(2,"0"),f=String(e.getMilliseconds()).padStart(3,"0");return`${t}-${s}-${r} ${n}:${l}:${i}.${f}`}log(e,t,s,r,n){if(e<this.getLevel())return;let l=this.formatTimestamp(new Date),i=cs[e].padEnd(5),f=t.padEnd(6),d="";r?.correlationId?d=`[${r.correlationId}] `:r?.sessionId&&(d=`[session-${r.sessionId}] `);let h="";n!=null&&(this.getLevel()===0&&typeof n=="object"?h=`
|
|
`+JSON.stringify(n,null,2):h=" "+this.formatData(n));let m="";if(r){let{sessionId:c,sdkSessionId:y,correlationId:_,...v}=r;Object.keys(v).length>0&&(m=` {${Object.entries(v).map(([T,x])=>`${T}=${x}`).join(", ")}}`)}let E=`[${l}] [${i}] [${f}] ${d}${s}${m}${h}`;e===3?console.error(E):console.log(E)}debug(e,t,s,r){this.log(0,e,t,s,r)}info(e,t,s,r){this.log(1,e,t,s,r)}warn(e,t,s,r){this.log(2,e,t,s,r)}error(e,t,s,r){this.log(3,e,t,s,r)}dataIn(e,t,s,r){this.info(e,`\u2192 ${t}`,s,r)}dataOut(e,t,s,r){this.info(e,`\u2190 ${t}`,s,r)}success(e,t,s,r){this.info(e,`\u2713 ${t}`,s,r)}failure(e,t,s,r){this.error(e,`\u2717 ${t}`,s,r)}timing(e,t,s,r){this.info(e,`\u23F1 ${t}`,r,{duration:`${s}ms`})}happyPathError(e,t,s,r,n=""){let d=((new Error().stack||"").split(`
|
|
`)[2]||"").match(/at\s+(?:.*\s+)?\(?([^:]+):(\d+):(\d+)\)?/),h=d?`${d[1].split("/").pop()}:${d[2]}`:"unknown",m={...s,location:h};return this.warn(e,`[HAPPY-PATH] ${t}`,m,r),n}},me=new us;var pa=Ea(require("path"),1),go=require("os");var ds={DEFAULT:5e3,HEALTH_CHECK:1e3,WORKER_STARTUP_WAIT:1e3,WORKER_STARTUP_RETRIES:15,PRE_RESTART_SETTLE_DELAY:2e3,WINDOWS_MULTIPLIER:1.5};function ho(a){return process.platform==="win32"?Math.round(a*ds.WINDOWS_MULTIPLIER):a}var da=require("path");var vo=require("os");var Ie=require("path"),po=require("os");var mo=require("url");var jd={};function Nd(){return typeof __dirname<"u"?__dirname:(0,Ie.dirname)((0,mo.fileURLToPath)(jd.url))}var Vh=Nd(),ar=We.get("CLAUDE_MEM_DATA_DIR"),fs=process.env.CLAUDE_CONFIG_DIR||(0,Ie.join)((0,po.homedir)(),".claude"),Hh=(0,Ie.join)(ar,"archives"),zh=(0,Ie.join)(ar,"logs"),Wh=(0,Ie.join)(ar,"trash"),Bh=(0,Ie.join)(ar,"backups"),Qh=(0,Ie.join)(ar,"settings.json"),Zh=(0,Ie.join)(ar,"claude-mem.db"),Kh=(0,Ie.join)(ar,"vector-db"),Gh=(0,Ie.join)(fs,"settings.json"),Jh=(0,Ie.join)(fs,"commands"),Yh=(0,Ie.join)(fs,"CLAUDE.md");var ip=(0,da.join)(ar,"worker.pid"),op=(0,da.join)(ar,"logs"),lp=(0,da.join)((0,vo.homedir)(),".claude","plugins","marketplaces","thedotmack");var yp=pa.default.join((0,go.homedir)(),".claude","plugins","marketplaces","thedotmack"),_p=ho(ds.HEALTH_CHECK),fa=null,ha=null;function yo(){if(fa!==null)return fa;let a=pa.default.join(We.get("CLAUDE_MEM_DATA_DIR"),"settings.json"),e=We.loadFromFile(a);return fa=parseInt(e.CLAUDE_MEM_WORKER_PORT,10),fa}function _o(){if(ha!==null)return ha;let a=pa.default.join(We.get("CLAUDE_MEM_DATA_DIR"),"settings.json");return ha=We.loadFromFile(a).CLAUDE_MEM_WORKER_HOST,ha}console.log=(...a)=>console.error(...a);var Ld=yo(),Fd=_o(),lt=`http://${Fd}:${Ld}`,xt={search:"/api/search",timeline:"/api/timeline",get_recent_context:"/api/context/recent",get_context_timeline:"/api/context/timeline",help:"/api/instructions"},hs={search:{query:{type:"string",description:"Full-text search query"},type:{type:"string",description:"Filter by type: tool_use, tool_result, prompt, summary"},obs_type:{type:"string",description:"Observation type filter"},concepts:{type:"string",description:"Comma-separated concept tags"},files:{type:"string",description:"Comma-separated file paths"},project:{type:"string",description:"Project name filter"},dateStart:{type:["string","number"],description:"Start date (ISO or timestamp)"},dateEnd:{type:["string","number"],description:"End date (ISO or timestamp)"},limit:{type:"number",description:"Max results (default: 10)"},offset:{type:"number",description:"Result offset for pagination"},orderBy:{type:"string",description:"Sort order: created_at, relevance"}},timeline:{query:{type:"string",description:"Search query to find anchor point"},anchor:{type:"number",description:"Observation ID as timeline center"},depth_before:{type:"number",description:"Observations before anchor (default: 5)"},depth_after:{type:"number",description:"Observations after anchor (default: 5)"},type:{type:"string",description:"Filter by type"},concepts:{type:"string",description:"Comma-separated concept tags"},files:{type:"string",description:"Comma-separated file paths"},project:{type:"string",description:"Project name filter"}},get_recent_context:{limit:{type:"number",description:"Max results (default: 20)"},type:{type:"string",description:"Filter by type"},concepts:{type:"string",description:"Comma-separated concept tags"},files:{type:"string",description:"Comma-separated file paths"},project:{type:"string",description:"Project name filter"},dateStart:{type:["string","number"],description:"Start date"},dateEnd:{type:["string","number"],description:"End date"}},get_context_timeline:{anchor:{type:"number",description:"Observation ID (required)",required:!0},depth_before:{type:"number",description:"Observations before anchor"},depth_after:{type:"number",description:"Observations after anchor"},type:{type:"string",description:"Filter by type"},concepts:{type:"string",description:"Comma-separated concept tags"},files:{type:"string",description:"Comma-separated file paths"},project:{type:"string",description:"Project name filter"}},get_observations:{ids:{type:"array",items:{type:"number"},description:"Array of observation IDs (required)",required:!0},orderBy:{type:"string",description:"Sort order"},limit:{type:"number",description:"Max results"},project:{type:"string",description:"Project filter"}},help:{operation:{type:"string",description:'Operation type: "observations", "timeline", "sessions", etc.'},topic:{type:"string",description:"Specific topic for help"}},get_observation:{id:{type:"number",description:"Observation ID (required)",required:!0}},get_session:{id:{type:"number",description:"Session ID (required)",required:!0}},get_prompt:{id:{type:"number",description:"Prompt ID (required)",required:!0}}};async function wt(a,e){me.debug("SYSTEM","\u2192 Worker API",void 0,{endpoint:a,params:e});try{let t=new URLSearchParams;for(let[l,i]of Object.entries(e))i!=null&&t.append(l,String(i));let s=`${lt}${a}?${t}`,r=await fetch(s);if(!r.ok){let l=await r.text();throw new Error(`Worker API error (${r.status}): ${l}`)}let n=await r.json();return me.debug("SYSTEM","\u2190 Worker API success",void 0,{endpoint:a}),n}catch(t){return me.error("SYSTEM","\u2190 Worker API error",void 0,{endpoint:a,error:t.message}),{content:[{type:"text",text:`Error calling Worker API: ${t.message}`}],isError:!0}}}async function ps(a,e){me.debug("HTTP","Worker API request (path)",void 0,{endpoint:a,id:e});try{let t=`${lt}${a}/${e}`,s=await fetch(t);if(!s.ok){let n=await s.text();throw new Error(`Worker API error (${s.status}): ${n}`)}let r=await s.json();return me.debug("HTTP","Worker API success (path)",void 0,{endpoint:a,id:e}),{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(t){return me.error("HTTP","Worker API error (path)",void 0,{endpoint:a,id:e,error:t.message}),{content:[{type:"text",text:`Error calling Worker API: ${t.message}`}],isError:!0}}}async function Md(a,e){me.debug("HTTP","Worker API request (POST)",void 0,{endpoint:a});try{let t=`${lt}${a}`,s=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!s.ok){let n=await s.text();throw new Error(`Worker API error (${s.status}): ${n}`)}let r=await s.json();return me.debug("HTTP","Worker API success (POST)",void 0,{endpoint:a}),{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(t){return me.error("HTTP","Worker API error (POST)",void 0,{endpoint:a,error:t.message}),{content:[{type:"text",text:`Error calling Worker API: ${t.message}`}],isError:!0}}}async function qd(){try{return(await fetch(`${lt}/api/health`)).ok}catch{return!1}}var Eo=[{name:"get_schema",description:"Get parameter schema for a tool. Call get_schema(tool_name) for details",inputSchema:{type:"object",properties:{tool_name:{type:"string"}},required:["tool_name"]},handler:async a=>{let e=a.tool_name;if(typeof e!="string"||!Object.hasOwn(hs,e))return{content:[{type:"text",text:`Unknown tool: ${e}
|
|
|
|
Available tools: ${Object.keys(hs).join(", ")}`}],isError:!0};let t=hs[e];return{content:[{type:"text",text:`# ${e} Parameters
|
|
|
|
${JSON.stringify(t,null,2)}`}]}}},{name:"search",description:'Search memory. All parameters optional - call get_schema("search") for details',inputSchema:{type:"object",properties:{},additionalProperties:!0},handler:async a=>{let e=xt.search;return await wt(e,a)}},{name:"timeline",description:'Timeline context. All parameters optional - call get_schema("timeline") for details',inputSchema:{type:"object",properties:{},additionalProperties:!0},handler:async a=>{let e=xt.timeline;return await wt(e,a)}},{name:"get_recent_context",description:'Recent context. All parameters optional - call get_schema("get_recent_context") for details',inputSchema:{type:"object",properties:{},additionalProperties:!0},handler:async a=>{let e=xt.get_recent_context;return await wt(e,a)}},{name:"get_context_timeline",description:"Timeline around observation ID",inputSchema:{type:"object",properties:{anchor:{type:"number",description:'Observation ID (required). Optional params: get_schema("get_context_timeline")'}},required:["anchor"],additionalProperties:!0},handler:async a=>{let e=xt.get_context_timeline;return await wt(e,a)}},{name:"help",description:'Get detailed docs. All parameters optional - call get_schema("help") for details',inputSchema:{type:"object",properties:{},additionalProperties:!0},handler:async a=>{let e=xt.help;return await wt(e,a)}},{name:"get_observation",description:"Fetch observation by ID",inputSchema:{type:"object",properties:{id:{type:"number",description:"Observation ID (required)"}},required:["id"]},handler:async a=>await ps("/api/observation",a.id)},{name:"get_observations",description:"Batch fetch observations",inputSchema:{type:"object",properties:{ids:{type:"array",items:{type:"number"},description:'Array of observation IDs (required). Optional params: get_schema("get_observations")'}},required:["ids"],additionalProperties:!0},handler:async a=>await Md("/api/observations/batch",a)},{name:"get_session",description:"Fetch session by ID",inputSchema:{type:"object",properties:{id:{type:"number",description:"Session ID (required)"}},required:["id"]},handler:async a=>await ps("/api/session",a.id)},{name:"get_prompt",description:"Fetch prompt by ID",inputSchema:{type:"object",properties:{id:{type:"number",description:"Prompt ID (required)"}},required:["id"]},handler:async a=>await ps("/api/prompt",a.id)}],ms=new la({name:"mem-search-server",version:"1.0.0"},{capabilities:{tools:{}}});ms.setRequestHandler(Ca,async()=>({tools:Eo.map(a=>({name:a.name,description:a.description,inputSchema:a.inputSchema}))}));ms.setRequestHandler(Da,async a=>{let e=Eo.find(t=>t.name===a.params.name);if(!e)throw new Error(`Unknown tool: ${a.params.name}`);try{return await e.handler(a.params.arguments||{})}catch(t){return{content:[{type:"text",text:`Tool execution failed: ${t.message}`}],isError:!0}}});async function So(){me.info("SYSTEM","MCP server shutting down"),process.exit(0)}process.on("SIGTERM",So);process.on("SIGINT",So);async function Ud(){let a=new ua;await ms.connect(a),me.info("SYSTEM","Claude-mem search server started"),setTimeout(async()=>{await qd()?me.info("SYSTEM","Worker available",void 0,{workerUrl:lt}):(me.warn("SYSTEM","Worker not available",void 0,{workerUrl:lt}),me.warn("SYSTEM","Tools will fail until Worker is started"),me.warn("SYSTEM","Start Worker with: claude-mem restart"))},0)}Ud().catch(a=>{me.error("SYSTEM","Fatal error",void 0,a),process.exit(1)});
|
|
/*! Bundled license information:
|
|
|
|
uri-js/dist/es5/uri.all.js:
|
|
(** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
|
|
*/
|