@wonderwhy-er/desktop-commander
Version:
MCP server for terminal operations and file editing
5 lines • 1.17 MB
JavaScript
"use strict";(()=>{var HM=Object.create;var sl=Object.defineProperty;var qM=Object.getOwnPropertyDescriptor;var WM=Object.getOwnPropertyNames;var VM=Object.getPrototypeOf,JM=Object.prototype.hasOwnProperty;var KM=(e,t,n)=>t in e?sl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qv=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zi=(e,t)=>{for(var n in t)sl(e,n,{get:t[n],enumerable:!0})},GM=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of WM(t))!JM.call(e,r)&&r!==n&&sl(e,r,{get:()=>t[r],enumerable:!(i=qM(t,r))||i.enumerable});return e};var ey=(e,t,n)=>(n=e!=null?HM(VM(e)):{},GM(t||!e||!e.__esModule?sl(n,"default",{value:e,enumerable:!0}):n,e));var At=(e,t,n)=>KM(e,typeof t!="symbol"?t+"":t,n);var Y$=Qv((xQ,X$)=>{function F$(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&F$(n)}),e}var Vu=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function B$(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ir(e,...t){let n=Object.create(null);for(let i in e)n[i]=e[i];return t.forEach(function(i){for(let r in i)n[r]=i[r]}),n}var v8="</span>",N$=e=>!!e.scope,y8=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((i,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`},Dm=class{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=B$(t)}openNode(t){if(!N$(t))return;let n=y8(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){N$(t)&&(this.buffer+=v8)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},D$=(e={})=>{let t={children:[]};return Object.assign(t,e),t},Om=class e{constructor(){this.rootNode=D$(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let n=D$({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(i=>this._walk(t,i)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{e._collapse(n)}))}},Rm=class extends Om{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){let i=t.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new Dm(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Xs(e){return e?typeof e=="string"?e:e.source:null}function U$(e){return ui("(?=",e,")")}function x8(e){return ui("(?:",e,")*")}function k8(e){return ui("(?:",e,")?")}function ui(...e){return e.map(n=>Xs(n)).join("")}function _8(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Lm(...e){return"("+(_8(e).capture?"":"?:")+e.map(i=>Xs(i)).join("|")+")"}function j$(e){return new RegExp(e.toString()+"|").exec("").length-1}function w8(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S8=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Fm(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;let r=n,o=Xs(i),s="";for(;o.length>0;){let a=S8.exec(o);if(!a){s+=o;break}s+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+r):(s+=a[0],a[0]==="("&&n++)}return s}).map(i=>`(${i})`).join(t)}var E8=/\b\B/,Z$="[a-zA-Z]\\w*",Bm="[a-zA-Z_]\\w*",H$="\\b\\d+(\\.\\d+)?",q$="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",W$="\\b(0b[01]+)",$8="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",C8=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=ui(t,/.*\b/,e.binary,/\b.*/)),Ir({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},Ys={begin:"\\\\[\\s\\S]",relevance:0},T8={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ys]},I8={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ys]},A8={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Ku=function(e,t,n={}){let i=Ir({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=Lm("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:ui(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},z8=Ku("//","$"),M8=Ku("/\\*","\\*/"),N8=Ku("#","$"),D8={scope:"number",begin:H$,relevance:0},O8={scope:"number",begin:q$,relevance:0},R8={scope:"number",begin:W$,relevance:0},P8={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ys,{begin:/\[/,end:/\]/,relevance:0,contains:[Ys]}]},L8={scope:"title",begin:Z$,relevance:0},F8={scope:"title",begin:Bm,relevance:0},B8={begin:"\\.\\s*"+Bm,relevance:0},U8=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})},Wu=Object.freeze({__proto__:null,APOS_STRING_MODE:T8,BACKSLASH_ESCAPE:Ys,BINARY_NUMBER_MODE:R8,BINARY_NUMBER_RE:W$,COMMENT:Ku,C_BLOCK_COMMENT_MODE:M8,C_LINE_COMMENT_MODE:z8,C_NUMBER_MODE:O8,C_NUMBER_RE:q$,END_SAME_AS_BEGIN:U8,HASH_COMMENT_MODE:N8,IDENT_RE:Z$,MATCH_NOTHING_RE:E8,METHOD_GUARD:B8,NUMBER_MODE:D8,NUMBER_RE:H$,PHRASAL_WORDS_MODE:A8,QUOTE_STRING_MODE:I8,REGEXP_MODE:P8,RE_STARTERS_RE:$8,SHEBANG:C8,TITLE_MODE:L8,UNDERSCORE_IDENT_RE:Bm,UNDERSCORE_TITLE_MODE:F8});function j8(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Z8(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function H8(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=j8,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function q8(e,t){Array.isArray(e.illegal)&&(e.illegal=Lm(...e.illegal))}function W8(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function V8(e,t){e.relevance===void 0&&(e.relevance=1)}var J8=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(i=>{delete e[i]}),e.keywords=n.keywords,e.begin=ui(n.beforeMatch,U$(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},K8=["of","and","for","in","not","or","if","then","parent","list","value"],G8="keyword";function V$(e,t,n=G8){let i=Object.create(null);return typeof e=="string"?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(o){Object.assign(i,V$(e[o],t,o))}),i;function r(o,s){t&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let l=a.split("|");i[l[0]]=[o,X8(l[0],l[1])]})}}function X8(e,t){return t?Number(t):Y8(e)?0:1}function Y8(e){return K8.includes(e.toLowerCase())}var O$={},li=e=>{console.error(e)},R$=(e,...t)=>{console.log(`WARN: ${e}`,...t)},co=(e,t)=>{O$[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),O$[`${e}/${t}`]=!0)},Ju=new Error;function J$(e,t,{key:n}){let i=0,r=e[n],o={},s={};for(let a=1;a<=t.length;a++)s[a+i]=r[a],o[a+i]=!0,i+=j$(t[a-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function Q8(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw li("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ju;if(typeof e.beginScope!="object"||e.beginScope===null)throw li("beginScope must be object"),Ju;J$(e,e.begin,{key:"beginScope"}),e.begin=Fm(e.begin,{joinWith:""})}}function e9(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw li("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ju;if(typeof e.endScope!="object"||e.endScope===null)throw li("endScope must be object"),Ju;J$(e,e.end,{key:"endScope"}),e.end=Fm(e.end,{joinWith:""})}}function t9(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function n9(e){t9(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Q8(e),e9(e)}function r9(e){function t(s,a){return new RegExp(Xs(s),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=j$(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=t(Fm(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let u=l.findIndex((d,f)=>f>0&&d!==void 0),c=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,c)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new n;return this.rules.slice(a).forEach(([u,c])=>l.addRule(u,c)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(a);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){let c=this.getMatcher(0);c.lastIndex=this.lastIndex+1,u=c.exec(a)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(s){let a=new i;return s.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function o(s,a){let l=s;if(s.isCompiled)return l;[Z8,W8,n9,J8].forEach(c=>c(s,a)),e.compilerExtensions.forEach(c=>c(s,a)),s.__beforeBegin=null,[H8,q8,V8].forEach(c=>c(s,a)),s.isCompiled=!0;let u=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),u=s.keywords.$pattern,delete s.keywords.$pattern),u=u||/\w+/,s.keywords&&(s.keywords=V$(s.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),a&&(s.begin||(s.begin=/\B|\b/),l.beginRe=t(l.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(l.endRe=t(l.end)),l.terminatorEnd=Xs(l.end)||"",s.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(l.illegalRe=t(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(c){return i9(c==="self"?s:c)})),s.contains.forEach(function(c){o(c,l)}),s.starts&&o(s.starts,a),l.matcher=r(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Ir(e.classNameAliases||{}),o(e)}function K$(e){return e?e.endsWithParent||K$(e.starts):!1}function i9(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Ir(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:K$(e)?Ir(e,{starts:e.starts?Ir(e.starts):null}):Object.isFrozen(e)?Ir(e):e}var o9="11.11.1",Pm=class extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}},Nm=B$,P$=Ir,L$=Symbol("nomatch"),s9=7,G$=function(e){let t=Object.create(null),n=Object.create(null),i=[],r=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Rm};function l(A){return a.noHighlightRe.test(A)}function u(A){let Z=A.className+" ";Z+=A.parentNode?A.parentNode.className:"";let q=a.languageDetectRe.exec(Z);if(q){let re=z(q[1]);return re||(R$(o.replace("{}",q[1])),R$("Falling back to no-highlight mode for this block.",A)),re?q[1]:"no-highlight"}return Z.split(/\s+/).find(re=>l(re)||z(re))}function c(A,Z,q){let re="",pe="";typeof Z=="object"?(re=A,q=Z.ignoreIllegals,pe=Z.language):(co("10.7.0","highlight(lang, code, ...args) has been deprecated."),co("10.7.0",`Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`),pe=A,re=Z),q===void 0&&(q=!0);let _={code:re,language:pe};ve("before:highlight",_);let S=_.result?_.result:d(_.language,_.code,q);return S.code=_.code,ve("after:highlight",S),S}function d(A,Z,q,re){let pe=Object.create(null);function _($,D){return $.keywords[D]}function S(){if(!le.keywords){st.addText(Ae);return}let $=0;le.keywordPatternRe.lastIndex=0;let D=le.keywordPatternRe.exec(Ae),U="";for(;D;){U+=Ae.substring($,D.index);let ue=Ye.case_insensitive?D[0].toLowerCase():D[0],Se=_(le,ue);if(Se){let[at,Mn]=Se;if(st.addText(U),U="",pe[ue]=(pe[ue]||0)+1,pe[ue]<=s9&&(Gr+=Mn),at.startsWith("_"))U+=D[0];else{let Xr=Ye.classNameAliases[at]||at;oe(D[0],Xr)}}else U+=D[0];$=le.keywordPatternRe.lastIndex,D=le.keywordPatternRe.exec(Ae)}U+=Ae.substring($),st.addText(U)}function O(){if(Ae==="")return;let $=null;if(typeof le.subLanguage=="string"){if(!t[le.subLanguage]){st.addText(Ae);return}$=d(le.subLanguage,Ae,!0,Vo[le.subLanguage]),Vo[le.subLanguage]=$._top}else $=p(Ae,le.subLanguage.length?le.subLanguage:null);le.relevance>0&&(Gr+=$.relevance),st.__addSublanguage($._emitter,$.language)}function L(){le.subLanguage!=null?O():S(),Ae=""}function oe($,D){$!==""&&(st.startScope(D),st.addText($),st.endScope())}function ee($,D){let U=1,ue=D.length-1;for(;U<=ue;){if(!$._emit[U]){U++;continue}let Se=Ye.classNameAliases[$[U]]||$[U],at=D[U];Se?oe(at,Se):(Ae=at,S(),Ae=""),U++}}function $e($,D){return $.scope&&typeof $.scope=="string"&&st.openNode(Ye.classNameAliases[$.scope]||$.scope),$.beginScope&&($.beginScope._wrap?(oe(Ae,Ye.classNameAliases[$.beginScope._wrap]||$.beginScope._wrap),Ae=""):$.beginScope._multi&&(ee($.beginScope,D),Ae="")),le=Object.create($,{parent:{value:le}}),le}function ft($,D,U){let ue=w8($.endRe,U);if(ue){if($["on:end"]){let Se=new Vu($);$["on:end"](D,Se),Se.isMatchIgnored&&(ue=!1)}if(ue){for(;$.endsParent&&$.parent;)$=$.parent;return $}}if($.endsWithParent)return ft($.parent,D,U)}function ke($){return le.matcher.regexIndex===0?(Ae+=$[0],1):(ji=!0,0)}function Re($){let D=$[0],U=$.rule,ue=new Vu(U),Se=[U.__beforeBegin,U["on:begin"]];for(let at of Se)if(at&&(at($,ue),ue.isMatchIgnored))return ke(D);return U.skip?Ae+=D:(U.excludeBegin&&(Ae+=D),L(),!U.returnBegin&&!U.excludeBegin&&(Ae=D)),$e(U,$),U.returnBegin?0:D.length}function vt($){let D=$[0],U=Z.substring($.index),ue=ft(le,$,U);if(!ue)return L$;let Se=le;le.endScope&&le.endScope._wrap?(L(),oe(D,le.endScope._wrap)):le.endScope&&le.endScope._multi?(L(),ee(le.endScope,$)):Se.skip?Ae+=D:(Se.returnEnd||Se.excludeEnd||(Ae+=D),L(),Se.excludeEnd&&(Ae=D));do le.scope&&st.closeNode(),!le.skip&&!le.subLanguage&&(Gr+=le.relevance),le=le.parent;while(le!==ue.parent);return ue.starts&&$e(ue.starts,$),Se.returnEnd?0:D.length}function It(){let $=[];for(let D=le;D!==Ye;D=D.parent)D.scope&&$.unshift(D.scope);$.forEach(D=>st.openNode(D))}let Xe={};function Ne($,D){let U=D&&D[0];if(Ae+=$,U==null)return L(),0;if(Xe.type==="begin"&&D.type==="end"&&Xe.index===D.index&&U===""){if(Ae+=Z.slice(D.index,D.index+1),!r){let ue=new Error(`0 width match regex (${A})`);throw ue.languageName=A,ue.badRule=Xe.rule,ue}return 1}if(Xe=D,D.type==="begin")return Re(D);if(D.type==="illegal"&&!q){let ue=new Error('Illegal lexeme "'+U+'" for mode "'+(le.scope||"<unnamed>")+'"');throw ue.mode=le,ue}else if(D.type==="end"){let ue=vt(D);if(ue!==L$)return ue}if(D.type==="illegal"&&U==="")return Ae+=`
`,1;if(Ui>1e5&&Ui>D.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ae+=U,U.length}let Ye=z(A);if(!Ye)throw li(o.replace("{}",A)),new Error('Unknown language: "'+A+'"');let Bi=r9(Ye),An="",le=re||Bi,Vo={},st=new a.__emitter(a);It();let Ae="",Gr=0,zn=0,Ui=0,ji=!1;try{if(Ye.__emitTokens)Ye.__emitTokens(Z,st);else{for(le.matcher.considerAll();;){Ui++,ji?ji=!1:le.matcher.considerAll(),le.matcher.lastIndex=zn;let $=le.matcher.exec(Z);if(!$)break;let D=Z.substring(zn,$.index),U=Ne(D,$);zn=$.index+U}Ne(Z.substring(zn))}return st.finalize(),An=st.toHTML(),{language:A,value:An,relevance:Gr,illegal:!1,_emitter:st,_top:le}}catch($){if($.message&&$.message.includes("Illegal"))return{language:A,value:Nm(Z),illegal:!0,relevance:0,_illegalBy:{message:$.message,index:zn,context:Z.slice(zn-100,zn+100),mode:$.mode,resultSoFar:An},_emitter:st};if(r)return{language:A,value:Nm(Z),illegal:!1,relevance:0,errorRaised:$,_emitter:st,_top:le};throw $}}function f(A){let Z={value:Nm(A),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return Z._emitter.addText(A),Z}function p(A,Z){Z=Z||a.languages||Object.keys(t);let q=f(A),re=Z.filter(z).filter(ce).map(L=>d(L,A,!1));re.unshift(q);let pe=re.sort((L,oe)=>{if(L.relevance!==oe.relevance)return oe.relevance-L.relevance;if(L.language&&oe.language){if(z(L.language).supersetOf===oe.language)return 1;if(z(oe.language).supersetOf===L.language)return-1}return 0}),[_,S]=pe,O=_;return O.secondBest=S,O}function h(A,Z,q){let re=Z&&n[Z]||q;A.classList.add("hljs"),A.classList.add(`language-${re}`)}function m(A){let Z=null,q=u(A);if(l(q))return;if(ve("before:highlightElement",{el:A,language:q}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),a.throwUnescapedHTML))throw new Pm("One of your code blocks includes unescaped HTML.",A.innerHTML);Z=A;let re=Z.textContent,pe=q?c(re,{language:q,ignoreIllegals:!0}):p(re);A.innerHTML=pe.value,A.dataset.highlighted="yes",h(A,q,pe.language),A.result={language:pe.language,re:pe.relevance,relevance:pe.relevance},pe.secondBest&&(A.secondBest={language:pe.secondBest.language,relevance:pe.secondBest.relevance}),ve("after:highlightElement",{el:A,result:pe,text:re})}function b(A){a=P$(a,A)}let g=()=>{k(),co("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function v(){k(),co("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function k(){function A(){k()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",A,!1),x=!0;return}document.querySelectorAll(a.cssSelector).forEach(m)}function E(A,Z){let q=null;try{q=Z(e)}catch(re){if(li("Language definition for '{}' could not be registered.".replace("{}",A)),r)li(re);else throw re;q=s}q.name||(q.name=A),t[A]=q,q.rawDefinition=Z.bind(null,e),q.aliases&&H(q.aliases,{languageName:A})}function C(A){delete t[A];for(let Z of Object.keys(n))n[Z]===A&&delete n[Z]}function M(){return Object.keys(t)}function z(A){return A=(A||"").toLowerCase(),t[A]||t[n[A]]}function H(A,{languageName:Z}){typeof A=="string"&&(A=[A]),A.forEach(q=>{n[q.toLowerCase()]=Z})}function ce(A){let Z=z(A);return Z&&!Z.disableAutodetect}function Ze(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=Z=>{A["before:highlightBlock"](Object.assign({block:Z.el},Z))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=Z=>{A["after:highlightBlock"](Object.assign({block:Z.el},Z))})}function Fe(A){Ze(A),i.push(A)}function Ie(A){let Z=i.indexOf(A);Z!==-1&&i.splice(Z,1)}function ve(A,Z){let q=A;i.forEach(function(re){re[q]&&re[q](Z)})}function Y(A){return co("10.7.0","highlightBlock will be removed entirely in v12.0"),co("10.7.0","Please use highlightElement now."),m(A)}Object.assign(e,{highlight:c,highlightAuto:p,highlightAll:k,highlightElement:m,highlightBlock:Y,configure:b,initHighlighting:g,initHighlightingOnLoad:v,registerLanguage:E,unregisterLanguage:C,listLanguages:M,getLanguage:z,registerAliases:H,autoDetection:ce,inherit:P$,addPlugin:Fe,removePlugin:Ie}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=o9,e.regex={concat:ui,lookahead:U$,either:Lm,optional:k8,anyNumberOfTimes:x8};for(let A in Wu)typeof Wu[A]=="object"&&F$(Wu[A]);return Object.assign(e,Wu),e},fo=G$({});fo.newInstance=()=>G$({});X$.exports=fo;fo.HighlightJS=fo;fo.default=fo});var Az=Qv((Sle,Iz)=>{var Tv=!0,Cz=!1,Tz=!1;Iz.exports=function(e,t){t&&(Tv=!t.enabled,Cz=!!t.label,Tz=!!t.labelAfter),e.core.ruler.after("inline","github-task-lists",function(n){for(var i=n.tokens,r=2;r<i.length;r++)sq(i,r)&&(aq(i[r],n.Token),$z(i[r-2],"class","task-list-item"+(Tv?"":" enabled")),$z(i[oq(i,r-2)],"class","contains-task-list"))})};function $z(e,t,n){var i=e.attrIndex(t),r=[t,n];i<0?e.attrPush(r):e.attrs[i]=r}function oq(e,t){for(var n=e[t].level-1,i=t-1;i>=0;i--)if(e[i].level===n)return i;return-1}function sq(e,t){return fq(e[t])&&pq(e[t-1])&&hq(e[t-2])&&mq(e[t])}function aq(e,t){if(e.children.unshift(lq(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),Cz)if(Tz){e.children.pop();var n="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+n+'">',e.children.push(dq(e.content,n,t))}else e.children.unshift(uq(t)),e.children.push(cq(t))}function lq(e,t){var n=new t("html_inline","",0),i=Tv?' disabled="" ':"";return e.content.indexOf("[ ] ")===0?n.content='<input class="task-list-item-checkbox"'+i+'type="checkbox">':(e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0)&&(n.content='<input class="task-list-item-checkbox" checked=""'+i+'type="checkbox">'),n}function uq(e){var t=new e("html_inline","",0);return t.content="<label>",t}function cq(e){var t=new e("html_inline","",0);return t.content="</label>",t}function dq(e,t,n){var i=new n("html_inline","",0);return i.content='<label class="task-list-item-label" for="'+t+'">'+e+"</label>",i.attrs=[{for:t}],i}function fq(e){return e.type==="inline"}function pq(e){return e.type==="paragraph_open"}function hq(e){return e.type==="list_item_open"}function mq(e){return e.content.indexOf("[ ] ")===0||e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0}});var vV=Object.freeze({status:"aborted"});function I(e,t,n){function i(a,l){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,l);for(let c in s.prototype)c in a||Object.defineProperty(a,c,{value:s.prototype[c].bind(a)});a._zod.constr=s,a._zod.def=l}let r=n?.Parent??Object;class o extends r{}Object.defineProperty(o,"name",{value:e});function s(a){var l;let u=n?.Parent?new o:this;i(u,a),(l=u._zod).deferred??(l.deferred=[]);for(let c of u._zod.deferred)c();return u}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var Xn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},al={};function sn(e){return e&&Object.assign(al,e),al}var Ce={};Zi(Ce,{BIGINT_FORMAT_RANGES:()=>ny,Class:()=>Sf,NUMBER_FORMAT_RANGES:()=>Mf,aborted:()=>Qr,allowsEval:()=>If,assert:()=>t3,assertEqual:()=>XM,assertIs:()=>QM,assertNever:()=>e3,assertNotEqual:()=>YM,assignProp:()=>Tf,cached:()=>Go,captureStackTrace:()=>ul,cleanEnum:()=>h3,cleanRegex:()=>Yo,clone:()=>Nn,createTransparentProxy:()=>a3,defineLazy:()=>Be,esc:()=>Yr,escapeRegex:()=>_r,extend:()=>c3,finalizeIssue:()=>En,floatSafeRemainder:()=>Cf,getElementAtPath:()=>n3,getEnumValues:()=>Ef,getLengthableOrigin:()=>Qo,getParsedType:()=>s3,getSizableOrigin:()=>ry,isObject:()=>Hi,isPlainObject:()=>qi,issue:()=>Nf,joinValues:()=>ll,jsonStringifyReplacer:()=>$f,merge:()=>d3,normalizeParams:()=>ne,nullish:()=>Xo,numKeys:()=>o3,omit:()=>u3,optionalKeys:()=>zf,partial:()=>f3,pick:()=>l3,prefixIssues:()=>Dn,primitiveTypes:()=>ty,promiseAllObject:()=>r3,propertyKeyTypes:()=>Af,randomString:()=>i3,required:()=>p3,stringifyPrimitive:()=>cl,unwrapMessage:()=>Ko});function XM(e){return e}function YM(e){return e}function QM(e){}function e3(e){throw new Error}function t3(e){}function Ef(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function ll(e,t="|"){return e.map(n=>cl(n)).join(t)}function $f(e,t){return typeof t=="bigint"?t.toString():t}function Go(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Xo(e){return e==null}function Yo(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Cf(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(e.toFixed(r).replace(".","")),s=Number.parseInt(t.toFixed(r).replace(".",""));return o%s/10**r}function Be(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}throw new Error("cached value already set")},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Tf(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function n3(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function r3(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<t.length;o++)r[t[o]]=i[o];return r})}function i3(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function Yr(e){return JSON.stringify(e)}var ul=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Hi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var If=Go(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function qi(e){if(Hi(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(Hi(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function o3(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var s3=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Af=new Set(["string","number","symbol"]),ty=new Set(["string","number","bigint","boolean","symbol","undefined"]);function _r(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Nn(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function ne(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function a3(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function cl(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function zf(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Mf={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ny={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function l3(e,t){let n={},i=e._zod.def;for(let r in t){if(!(r in i.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(n[r]=i.shape[r])}return Nn(e,{...e._zod.def,shape:n,checks:[]})}function u3(e,t){let n={...e._zod.def.shape},i=e._zod.def;for(let r in t){if(!(r in i.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&delete n[r]}return Nn(e,{...e._zod.def,shape:n,checks:[]})}function c3(e,t){if(!qi(t))throw new Error("Invalid input to extend: expected a plain object");let n={...e._zod.def,get shape(){let i={...e._zod.def.shape,...t};return Tf(this,"shape",i),i},checks:[]};return Nn(e,n)}function d3(e,t){return Nn(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Tf(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function f3(e,t,n){let i=t._zod.def.shape,r={...i};if(n)for(let o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(r[o]=e?new e({type:"optional",innerType:i[o]}):i[o])}else for(let o in i)r[o]=e?new e({type:"optional",innerType:i[o]}):i[o];return Nn(t,{...t._zod.def,shape:r,checks:[]})}function p3(e,t,n){let i=t._zod.def.shape,r={...i};if(n)for(let o in n){if(!(o in r))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(r[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(let o in i)r[o]=new e({type:"nonoptional",innerType:i[o]});return Nn(t,{...t._zod.def,shape:r,checks:[]})}function Qr(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Dn(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Ko(e){return typeof e=="string"?e:e?.message}function En(e,t,n){let i={...e,path:e.path??[]};if(!e.message){let r=Ko(e.inst?._zod.def?.error?.(e))??Ko(t?.error?.(e))??Ko(n.customError?.(e))??Ko(n.localeError?.(e))??"Invalid input";i.message=r}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function ry(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Qo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Nf(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function h3(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var Sf=class{constructor(...t){}};var iy=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,$f,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},dl=I("$ZodError",iy),Df=I("$ZodError",iy,{Parent:Error});function oy(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):i.push(t(r));return{formErrors:i,fieldErrors:n}}function sy(e,t){let n=t||function(o){return o.message},i={_errors:[]},r=o=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)i._errors.push(n(s));else{let a=i,l=0;for(;l<s.path.length;){let u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(s))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return r(e),i}var ay=e=>(t,n,i,r)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Xn;if(s.issues.length){let a=new(r?.Err??e)(s.issues.map(l=>En(l,o,sn())));throw ul(a,r?.callee),a}return s.value};var ly=e=>async(t,n,i,r)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(r?.Err??e)(s.issues.map(l=>En(l,o,sn())));throw ul(a,r?.callee),a}return s.value};var Of=e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new Xn;return o.issues.length?{success:!1,error:new(e??dl)(o.issues.map(s=>En(s,r,sn())))}:{success:!0,data:o.value}},es=Of(Df),Rf=e=>async(t,n,i)=>{let r=i?Object.assign(i,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>En(s,r,sn())))}:{success:!0,data:o.value}},fl=Rf(Df);var uy=/^[cC][^\s-]{8,}$/,cy=/^[0-9a-z]+$/,dy=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,fy=/^[0-9a-vA-V]{20}$/,py=/^[A-Za-z0-9]{27}$/,hy=/^[a-zA-Z0-9_-]{21}$/,my=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var gy=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Pf=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;var by=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var g3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function vy(){return new RegExp(g3,"u")}var yy=/^(?:(?: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])$/,xy=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,ky=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,_y=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wy=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Lf=/^[A-Za-z0-9_-]*$/,Sy=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var Ey=/^\+(?:[0-9]){6,14}[0-9]$/,$y="(?:(?:\\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])))",Cy=new RegExp(`^${$y}$`);function Ty(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Iy(e){return new RegExp(`^${Ty(e)}$`)}function Ay(e){let t=Ty({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");let i=`${t}(?:${n.join("|")})`;return new RegExp(`^${$y}T(?:${i})$`)}var zy=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var My=/^\d+$/,Ny=/^-?\d+(?:\.\d+)?/i,Dy=/true|false/i,Oy=/null/i;var Ry=/^[^A-Z]*$/,Py=/^[^a-z]*$/;var zt=I("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ly={number:"number",bigint:"bigint",object:"date"},Bf=I("$ZodCheckLessThan",(e,t)=>{zt.init(e,t);let n=Ly[typeof t.value];e._zod.onattach.push(i=>{let r=i._zod.bag,o=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Uf=I("$ZodCheckGreaterThan",(e,t)=>{zt.init(e,t);let n=Ly[typeof t.value];e._zod.onattach.push(i=>{let r=i._zod.bag,o=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fy=I("$ZodCheckMultipleOf",(e,t)=>{zt.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Cf(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),By=I("$ZodCheckNumberFormat",(e,t)=>{zt.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,o]=Mf[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=r,a.maximum=o,n&&(a.pattern=My)}),e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:i,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort});return}}a<r&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inst:e})}});var Uy=I("$ZodCheckMaxLength",(e,t)=>{var n;zt.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Xo(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let r=i.value;if(r.length<=t.maximum)return;let s=Qo(r);i.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jy=I("$ZodCheckMinLength",(e,t)=>{var n;zt.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Xo(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let r=i.value;if(r.length>=t.minimum)return;let s=Qo(r);i.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Zy=I("$ZodCheckLengthEquals",(e,t)=>{var n;zt.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Xo(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=i=>{let r=i.value,o=r.length;if(o===t.length)return;let s=Qo(r),a=o>t.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),ts=I("$ZodCheckStringFormat",(e,t)=>{var n,i;zt.init(e,t),e._zod.onattach.push(r=>{let o=r._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Hy=I("$ZodCheckRegex",(e,t)=>{ts.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),qy=I("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ry),ts.init(e,t)}),Wy=I("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Py),ts.init(e,t)}),Vy=I("$ZodCheckIncludes",(e,t)=>{zt.init(e,t);let n=_r(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Jy=I("$ZodCheckStartsWith",(e,t)=>{zt.init(e,t);let n=new RegExp(`^${_r(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Ky=I("$ZodCheckEndsWith",(e,t)=>{zt.init(e,t);let n=new RegExp(`.*${_r(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});var Gy=I("$ZodCheckOverwrite",(e,t)=>{zt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var pl=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
`).filter(s=>s),r=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let t=Function,n=this?.args,r=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...n,r.join(`
`))}};var Yy={major:4,minor:0,patch:0};var Ue=I("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Yy;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let r of i)for(let o of r._zod.onattach)o(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(o,s,a)=>{let l=Qr(o),u;for(let c of s){if(c._zod.def.when){if(!c._zod.def.when(o))continue}else if(l)continue;let d=o.issues.length,f=c._zod.check(o);if(f instanceof Promise&&a?.async===!1)throw new Xn;if(u||f instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await f,o.issues.length!==d&&(l||(l=Qr(o,d)))});else{if(o.issues.length===d)continue;l||(l=Qr(o,d))}}return u?u.then(()=>o):o};e._zod.run=(o,s)=>{let a=e._zod.parse(o,s);if(a instanceof Promise){if(s.async===!1)throw new Xn;return a.then(l=>r(l,i,s))}return r(a,i,s)}}e["~standard"]={validate:r=>{try{let o=es(e,r);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return fl(e,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),ml=I("$ZodString",(e,t)=>{Ue.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??zy(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),He=I("$ZodStringFormat",(e,t)=>{ts.init(e,t),ml.init(e,t)}),l1=I("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=gy),He.init(e,t)}),u1=I("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Pf(i))}else t.pattern??(t.pattern=Pf());He.init(e,t)}),c1=I("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=by),He.init(e,t)}),d1=I("$ZodURL",(e,t)=>{He.init(e,t),e._zod.check=n=>{try{let i=n.value,r=new URL(i),o=r.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Sy.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!i.endsWith("/")&&o.endsWith("/")?n.value=o.slice(0,-1):n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),f1=I("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=vy()),He.init(e,t)}),p1=I("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=hy),He.init(e,t)}),h1=I("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=uy),He.init(e,t)}),m1=I("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=cy),He.init(e,t)}),g1=I("$ZodULID",(e,t)=>{t.pattern??(t.pattern=dy),He.init(e,t)}),b1=I("$ZodXID",(e,t)=>{t.pattern??(t.pattern=fy),He.init(e,t)}),v1=I("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=py),He.init(e,t)}),y1=I("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ay(t)),He.init(e,t)}),x1=I("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Cy),He.init(e,t)}),k1=I("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Iy(t)),He.init(e,t)}),_1=I("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=my),He.init(e,t)}),w1=I("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=yy),He.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format="ipv4"})}),S1=I("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=xy),He.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),E1=I("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ky),He.init(e,t)}),$1=I("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=_y),He.init(e,t),e._zod.check=n=>{let[i,r]=n.value.split("/");try{if(!r)throw new Error;let o=Number(r);if(`${o}`!==r)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function C1(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var T1=I("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=wy),He.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{C1(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function b3(e){if(!Lf.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return C1(n)}var I1=I("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Lf),He.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{b3(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),A1=I("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ey),He.init(e,t)});function v3(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var z1=I("$ZodJWT",(e,t)=>{He.init(e,t),e._zod.check=n=>{v3(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}});var Zf=I("$ZodNumber",(e,t)=>{Ue.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ny,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...o?{received:o}:{}}),n}}),M1=I("$ZodNumber",(e,t)=>{By.init(e,t),Zf.init(e,t)}),N1=I("$ZodBoolean",(e,t)=>{Ue.init(e,t),e._zod.pattern=Dy,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}});var D1=I("$ZodNull",(e,t)=>{Ue.init(e,t),e._zod.pattern=Oy,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}});var O1=I("$ZodUnknown",(e,t)=>{Ue.init(e,t),e._zod.parse=n=>n}),R1=I("$ZodNever",(e,t)=>{Ue.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Qy(e,t,n){e.issues.length&&t.issues.push(...Dn(n,e.issues)),t.value[n]=e.value}var P1=I("$ZodArray",(e,t)=>{Ue.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let o=[];for(let s=0;s<r.length;s++){let a=r[s],l=t.element._zod.run({value:a,issues:[]},i);l instanceof Promise?o.push(l.then(u=>Qy(u,n,s))):Qy(l,n,s)}return o.length?Promise.all(o).then(()=>n):n}});function hl(e,t,n){e.issues.length&&t.issues.push(...Dn(n,e.issues)),t.value[n]=e.value}function