nemar-cli 0.10.11-dev.3005 → 0.10.11-dev.3009

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -81,7 +81,7 @@ ${Wr.cursorShow}`)}releaseCursor(){if(this.extraLinesUnderPrompt>0)Z_(this.rl,th
81
81
  ${t}`,jSe,qSe,MSe=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=NSe.bind(null,n,t.toString());Object.defineProperty(o,"name",qSe);let{writable:i,enumerable:s,configurable:a}=jSe;Object.defineProperty(e,"toString",{value:o,writable:i,enumerable:s,configurable:a})};var Qv=O(()=>{jSe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),qSe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var xh,Bj=(e,t={})=>{if(typeof e!=="function")throw TypeError("Expected a function");let r,n=0,o=e.displayName||e.name||"<anonymous>",i=function(...s){if(xh.set(i,++n),n===1)r=e.apply(this,s),e=void 0;else if(t.throw===!0)throw Error(`Function \`${o}\` can only be called once`);return r};return sd(i,e),xh.set(i,n),i},Uj;var zj=O(()=>{Qv();xh=new WeakMap;Bj.callCount=(e)=>{if(!xh.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return xh.get(e)};Uj=Bj});var ua;var Vj=O(()=>{ua=[];ua.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")ua.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")ua.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class Gj{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(tw[ew])return tw[ew];LSe(tw,ew,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let r=this.listeners[e],n=r.indexOf(t);if(n===-1)return;if(n===0&&r.length===1)r.length=0;else r.splice(n,1)}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(let o of this.listeners[e])n=o(t,r)===!0||n;if(e==="exit")n=this.emit("afterExit",t,r)||n;return n}}class nw{}var _h=(e)=>!!e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function",ew,tw,LSe,BSe=(e)=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Hj,Wj,rw,Kj,Vit,Git;var Yj=O(()=>{Vj();ew=Symbol.for("signal-exit emitter"),tw=globalThis,LSe=Object.defineProperty.bind(Object);Hj=class Hj extends nw{onExit(){return()=>{}}load(){}unload(){}};Wj=class Wj extends nw{#r=rw.platform==="win32"?"SIGINT":"SIGHUP";#t=new Gj;#e;#o;#f;#n={};#s=!1;constructor(e){super();this.#e=e,this.#n={};for(let t of ua)this.#n[t]=()=>{let r=this.#e.listeners(t),{count:n}=this.#t,o=e;if(typeof o.__signal_exit_emitter__==="object"&&typeof o.__signal_exit_emitter__.count==="number")n+=o.__signal_exit_emitter__.count;if(r.length===n){this.unload();let i=this.#t.emit("exit",null,t),s=t==="SIGHUP"?this.#r:t;if(!i)e.kill(e.pid,s)}};this.#f=e.reallyExit,this.#o=e.emit}onExit(e,t){if(!_h(this.#e))return()=>{};if(this.#s===!1)this.load();let r=t?.alwaysLast?"afterExit":"exit";return this.#t.on(r,e),()=>{if(this.#t.removeListener(r,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0)this.unload()}}load(){if(this.#s)return;this.#s=!0,this.#t.count+=1;for(let e of ua)try{let t=this.#n[e];if(t)this.#e.on(e,t)}catch(t){}this.#e.emit=(e,...t)=>this.#p(e,...t),this.#e.reallyExit=(e)=>this.#i(e)}unload(){if(!this.#s)return;this.#s=!1,ua.forEach((e)=>{let t=this.#n[e];if(!t)throw Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,t)}catch(r){}}),this.#e.emit=this.#o,this.#e.reallyExit=this.#f,this.#t.count-=1}#i(e){if(!_h(this.#e))return 0;return this.#e.exitCode=e||0,this.#t.emit("exit",this.#e.exitCode,null),this.#f.call(this.#e,this.#e.exitCode)}#p(e,...t){let r=this.#o;if(e==="exit"&&_h(this.#e)){if(typeof t[0]==="number")this.#e.exitCode=t[0];let n=r.call(this.#e,e,...t);return this.#t.emit("exit",this.#e.exitCode,null),n}else return r.call(this.#e,e,...t)}};rw=globalThis.process,{onExit:Kj,load:Vit,unload:Git}=BSe(_h(rw)?new Wj(rw):new Hj)});import vh from"process";var Jj,USe,Xj;var Zj=O(()=>{zj();Yj();Jj=vh.stderr.isTTY?vh.stderr:vh.stdout.isTTY?vh.stdout:void 0,USe=Jj?Uj(()=>{Kj(()=>{Jj.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},Xj=USe});import Qj from"process";var wh=!1,Wc,ow;var eq=O(()=>{Zj();Wc={};Wc.show=(e=Qj.stderr)=>{if(!e.isTTY)return;wh=!1,e.write("\x1B[?25h")};Wc.hide=(e=Qj.stderr)=>{if(!e.isTTY)return;Xj(),wh=!0,e.write("\x1B[?25l")};Wc.toggle=(e,t)=>{if(e!==void 0)wh=e;if(wh)Wc.show(t);else Wc.hide(t)};ow=Wc});import qn from"process";function iw(){if(qn.platform!=="win32")return qn.env.TERM!=="linux";return Boolean(qn.env.CI)||Boolean(qn.env.WT_SESSION)||Boolean(qn.env.TERMINUS_SUBLIME)||qn.env.ConEmuTask==="{cmd::Cmder}"||qn.env.TERM_PROGRAM==="Terminus-Sublime"||qn.env.TERM_PROGRAM==="vscode"||qn.env.TERM==="xterm-256color"||qn.env.TERM==="alacritty"||qn.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var tq=()=>{};var zSe,VSe,GSe,ad;var rq=O(()=>{Xe();tq();zSe={info:l.blue("\u2139"),success:l.green("\u2714"),warning:l.yellow("\u26A0"),error:l.red("\u2716")},VSe={info:l.blue("i"),success:l.green("\u221A"),warning:l.yellow("\u203C"),error:l.red("\xD7")},GSe=iw()?zSe:VSe,ad=GSe});function sw({onlyFirst:e=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",e?void 0:"g")}function cd(e){if(typeof e!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(HSe,"")}var HSe;var aw=O(()=>{HSe=sw()});function nq(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function oq(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function iq(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var sq=()=>{};function WSe(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function aq(e,{ambiguousAsWide:t=!1}={}){if(WSe(e),oq(e)||iq(e)||t&&nq(e))return 2;return 1}var cq=O(()=>{sq()});var lq=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function cw(e,t={}){if(typeof e!=="string"||e.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=t;if(!n)e=cd(e);if(e.length===0)return 0;let o=0,i={ambiguousAsWide:!r};for(let{segment:s}of KSe.segment(e)){let a=s.codePointAt(0);if(a<=31||a>=127&&a<=159)continue;if(a>=8203&&a<=8207||a===65279)continue;if(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)continue;if(a>=55296&&a<=57343)continue;if(a>=65024&&a<=65039)continue;if(YSe.test(s))continue;if(lq().test(s)){o+=2;continue}o+=aq(a,i)}return o}var KSe,YSe;var uq=O(()=>{aw();cq();KSe=new Intl.Segmenter,YSe=/^\p{Default_Ignorable_Code_Point}$/u});function lw({stream:e=process.stdout}={}){return Boolean(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import dq from"process";function uw(){let{env:e}=dq,{TERM:t,TERM_PROGRAM:r}=e;if(dq.platform!=="win32")return t!=="linux";return Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var fq=()=>{};import Eo from"process";class pq{#r=0;start(){if(this.#r++,this.#r===1)this.#t()}stop(){if(this.#r<=0)throw Error("`stop` called more times than `start`");if(this.#r--,this.#r===0)this.#e()}#t(){if(Eo.platform==="win32"||!Eo.stdin.isTTY)return;Eo.stdin.setRawMode(!0),Eo.stdin.on("data",this.#o),Eo.stdin.resume()}#e(){if(!Eo.stdin.isTTY)return;Eo.stdin.off("data",this.#o),Eo.stdin.pause(),Eo.stdin.setRawMode(!1)}#o(e){if(e[0]===JSe)Eo.emit("SIGINT")}}var JSe=3,XSe,dw;var mq=O(()=>{XSe=new pq,dw=XSe});import Dh from"process";class hq{#r=0;#t=!1;#e=0;#o=-1;#f=0;#n;#s;#i;#p;#h;#l;#u;#d;#g;#a;#c;color;constructor(e){if(typeof e==="string")e={text:e};if(this.#n={color:"cyan",stream:Dh.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#n.color,this.spinner=this.#n.spinner,this.#h=this.#n.interval,this.#i=this.#n.stream,this.#l=typeof this.#n.isEnabled==="boolean"?this.#n.isEnabled:lw({stream:this.#i}),this.#u=typeof this.#n.isSilent==="boolean"?this.#n.isSilent:!1,this.text=this.#n.text,this.prefixText=this.#n.prefixText,this.suffixText=this.#n.suffixText,this.indent=this.#n.indent,Dh.env.NODE_ENV==="test")this._stream=this.#i,this._isEnabled=this.#l,Object.defineProperty(this,"_linesToClear",{get(){return this.#r},set(t){this.#r=t}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#o}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}})}get indent(){return this.#d}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw Error("The `indent` option must be an integer from 0 and up");this.#d=e,this.#m()}get interval(){return this.#h??this.#s.interval??100}get spinner(){return this.#s}set spinner(e){if(this.#o=-1,this.#h=void 0,typeof e==="object"){if(e.frames===void 0)throw Error("The given spinner must have a `frames` property");this.#s=e}else if(!uw())this.#s=ld.default.line;else if(e===void 0)this.#s=ld.default.dots;else if(e!=="default"&&ld.default[e])this.#s=ld.default[e];else throw Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(e=""){this.#g=e,this.#m()}get prefixText(){return this.#a}set prefixText(e=""){this.#a=e,this.#m()}get suffixText(){return this.#c}set suffixText(e=""){this.#c=e,this.#m()}get isSpinning(){return this.#p!==void 0}#y(e=this.#a,t=" "){if(typeof e==="string"&&e!=="")return e+t;if(typeof e==="function")return e()+t;return""}#b(e=this.#c,t=" "){if(typeof e==="string"&&e!=="")return t+e;if(typeof e==="function")return t+e();return""}#m(){let e=this.#i.columns??80,t=this.#y(this.#a,"-"),r=this.#b(this.#c,"-"),n=" ".repeat(this.#d)+t+"--"+this.#g+"--"+r;this.#e=0;for(let o of cd(n).split(`
82
82
  `))this.#e+=Math.max(1,Math.ceil(cw(o,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#l&&!this.#u}set isEnabled(e){if(typeof e!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#l=e}get isSilent(){return this.#u}set isSilent(e){if(typeof e!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#u=e}frame(){let e=Date.now();if(this.#o===-1||e-this.#f>=this.interval)this.#o=++this.#o%this.#s.frames.length,this.#f=e;let{frames:t}=this.#s,r=t[this.#o];if(this.color)r=l[this.color](r);let n=typeof this.#a==="string"&&this.#a!==""?this.#a+" ":"",o=typeof this.text==="string"?" "+this.text:"",i=typeof this.#c==="string"&&this.#c!==""?" "+this.#c:"";return n+r+o+i}clear(){if(!this.#l||!this.#i.isTTY)return this;this.#i.cursorTo(0);for(let e=0;e<this.#r;e++){if(e>0)this.#i.moveCursor(0,-1);this.#i.clearLine(1)}if(this.#d||this.lastIndent!==this.#d)this.#i.cursorTo(this.#d);return this.lastIndent=this.#d,this.#r=0,this}render(){if(this.#u)return this;return this.clear(),this.#i.write(this.frame()),this.#r=this.#e,this}start(e){if(e)this.text=e;if(this.#u)return this;if(!this.#l){if(this.text)this.#i.write(`- ${this.text}
83
83
  `);return this}if(this.isSpinning)return this;if(this.#n.hideCursor)ow.hide(this.#i);if(this.#n.discardStdin&&Dh.stdin.isTTY)this.#t=!0,dw.start();return this.render(),this.#p=setInterval(this.render.bind(this),this.interval),this}stop(){if(!this.#l)return this;if(clearInterval(this.#p),this.#p=void 0,this.#o=0,this.clear(),this.#n.hideCursor)ow.show(this.#i);if(this.#n.discardStdin&&Dh.stdin.isTTY&&this.#t)dw.stop(),this.#t=!1;return this}succeed(e){return this.stopAndPersist({symbol:ad.success,text:e})}fail(e){return this.stopAndPersist({symbol:ad.error,text:e})}warn(e){return this.stopAndPersist({symbol:ad.warning,text:e})}info(e){return this.stopAndPersist({symbol:ad.info,text:e})}stopAndPersist(e={}){if(this.#u)return this;let t=e.prefixText??this.#a,r=this.#y(t," "),n=e.symbol??" ",o=e.text??this.text,s=typeof o==="string"?(n?" ":"")+o:"",a=e.suffixText??this.#c,c=this.#b(a," "),u=r+n+s+c+`
84
- `;return this.stop(),this.#i.write(u),this}}function D(e){return new hq(e)}var ld,ZSe;var Mn=O(()=>{Xe();eq();rq();aw();uq();fq();mq();ld=ye(ym(),1),ZSe=ye(ym(),1)});var Ne,bq,W,ui=(e)=>{switch(typeof e){case"undefined":return W.undefined;case"string":return W.string;case"number":return Number.isNaN(e)?W.nan:W.number;case"boolean":return W.boolean;case"function":return W.function;case"bigint":return W.bigint;case"symbol":return W.symbol;case"object":if(Array.isArray(e))return W.array;if(e===null)return W.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return W.promise;if(typeof Map<"u"&&e instanceof Map)return W.map;if(typeof Set<"u"&&e instanceof Set)return W.set;if(typeof Date<"u"&&e instanceof Date)return W.date;return W.object;default:return W.unknown}};var ud=O(()=>{(function(e){e.assertEqual=(o)=>{};function t(o){}e.assertIs=t;function r(o){throw Error()}e.assertNever=r,e.arrayToEnum=(o)=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=(o)=>{let i=e.objectKeys(o).filter((a)=>typeof o[o[a]]!=="number"),s={};for(let a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=(o)=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys==="function"?(o)=>Object.keys(o):(o)=>{let i=[];for(let s in o)if(Object.prototype.hasOwnProperty.call(o,s))i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s;return},e.isInteger=typeof Number.isInteger==="function"?(o)=>Number.isInteger(o):(o)=>typeof o==="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map((s)=>typeof s==="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>{if(typeof i==="bigint")return i.toString();return i}})(Ne||(Ne={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(bq||(bq={}));W=Ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var M,Zr;var Eh=O(()=>{ud();M=Ne.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"]);Zr=class Zr extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(o){return o.message},r={_errors:[]},n=(o)=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let s=r,a=0;while(a<i.path.length){let c=i.path[a];if(a!==i.path.length-1)s[c]=s[c]||{_errors:[]};else s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(i));s=s[c],a++}}};return n(this),r}static assert(e){if(!(e instanceof Zr))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let o=n.path[0];t[o]=t[o]||[],t[o].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};Zr.create=(e)=>new Zr(e)});var QSe=(e,t)=>{let r;switch(e.code){case M.invalid_type:if(e.received===W.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case M.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ne.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ne.joinValues(e.keys,", ")}`;break;case M.invalid_union:r="Invalid input";break;case M.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ne.joinValues(e.options)}`;break;case M.invalid_enum_value:r=`Invalid enum value. Expected ${Ne.joinValues(e.options)}, received '${e.received}'`;break;case M.invalid_arguments:r="Invalid function arguments";break;case M.invalid_return_type:r="Invalid function return type";break;case M.invalid_date:r="Invalid date";break;case M.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)r=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)r=`Invalid input: must end with "${e.validation.endsWith}"`;else Ne.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case M.too_small:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else r="Invalid input";break;case M.too_big:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else r="Invalid input";break;case M.custom:r="Invalid input";break;case M.invalid_intersection_types:r="Intersection results could not be merged";break;case M.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case M.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ne.assertNever(e)}return{message:r}},ys;var fw=O(()=>{Eh();ud();ys=QSe});function dd(){return e$e}var e$e;var Sh=O(()=>{fw();e$e=ys});function G(e,t){let r=dd(),n=$h({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ys?void 0:ys].filter((o)=>!!o)});e.common.issues.push(n)}class ir{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let r=[];for(let n of t){if(n.status==="aborted")return de;if(n.status==="dirty")e.dirty();r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let n of t){let o=await n.key,i=await n.value;r.push({key:o,value:i})}return ir.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:o,value:i}=n;if(o.status==="aborted")return de;if(i.status==="aborted")return de;if(o.status==="dirty")e.dirty();if(i.status==="dirty")e.dirty();if(o.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet))r[o.value]=i.value}return{status:e.value,value:r}}}var $h=(e)=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",c=n.filter((u)=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},de,Kc=(e)=>({status:"dirty",value:e}),br=(e)=>({status:"valid",value:e}),pw=(e)=>e.status==="aborted",mw=(e)=>e.status==="dirty",da=(e)=>e.status==="valid",fd=(e)=>typeof Promise<"u"&&e instanceof Promise;var hw=O(()=>{Sh();fw();de=Object.freeze({status:"aborted"})});var xq=()=>{};var ne;var _q=O(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(ne||(ne={}))});class Ln{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function De(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:o};return{errorMap:(s,a)=>{let{message:c}=e;if(s.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??n??a.defaultError};if(s.code!=="invalid_type")return{message:a.defaultError};return{message:c??r??a.defaultError}},description:o}}class Fe{get description(){return this._def.description}_getType(e){return ui(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ui(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ir,ctx:{common:e.parent.common,data:e.data,parsedType:ui(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(fd(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ui(e)},n=this._parseSync({data:e,path:r.path,parent:r});return vq(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ui(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return da(r)?{value:r.value}:{issues:t.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((r)=>da(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ui(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(fd(n)?n:Promise.resolve(n));return vq(r,o)}refine(e,t){let r=(n)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(n);else return t};return this._refinement((n,o)=>{let i=e(n),s=()=>o.addIssue({code:M.custom,...r(n)});if(typeof Promise<"u"&&i instanceof Promise)return i.then((a)=>{if(!a)return s(),!1;else return!0});if(!i)return s(),!1;else return!0})}refinement(e,t){return this._refinement((r,n)=>{if(!e(r))return n.addIssue(typeof t==="function"?t(r,n):t),!1;else return!0})}_refinement(e){return new Co({schema:this,typeName:fe.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 $o.create(this,this._def)}nullable(){return bs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return So.create(this)}promise(){return Qc.create(this,this._def)}or(e){return yd.create([this,e],this._def)}and(e){return bd.create(this,e,this._def)}transform(e){return new Co({...De(this._def),schema:this,typeName:fe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new wd({...De(this._def),innerType:this,defaultValue:t,typeName:fe.ZodDefault})}brand(){return new xw({typeName:fe.ZodBranded,type:this,...De(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Dd({...De(this._def),innerType:this,catchValue:t,typeName:fe.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Ih.create(this,e)}readonly(){return Ed.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Dq(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function y$e(e){return new RegExp(`^${Dq(e)}$`)}function b$e(e){let t=`${wq}T${Dq(e)}`,r=[];if(r.push(e.local?"Z?":"Z"),e.offset)r.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function x$e(e,t){if((t==="v4"||!t)&&u$e.test(e))return!0;if((t==="v6"||!t)&&f$e.test(e))return!0;return!1}function _$e(e,t){if(!s$e.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));if(typeof o!=="object"||o===null)return!1;if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&o.alg!==t)return!1;return!0}catch{return!1}}function v$e(e,t){if((t==="v4"||!t)&&d$e.test(e))return!0;if((t==="v6"||!t)&&p$e.test(e))return!0;return!1}function w$e(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function Yc(e){if(e instanceof $t){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=$o.create(Yc(n))}return new $t({...e._def,shape:()=>t})}else if(e instanceof So)return new So({...e._def,type:Yc(e.element)});else if(e instanceof $o)return $o.create(Yc(e.unwrap()));else if(e instanceof bs)return bs.create(Yc(e.unwrap()));else if(e instanceof mi)return mi.create(e.items.map((t)=>Yc(t)));else return e}function yw(e,t){let r=ui(e),n=ui(t);if(e===t)return{valid:!0,data:e};else if(r===W.object&&n===W.object){let o=Ne.objectKeys(t),i=Ne.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=yw(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===W.array&&n===W.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],c=yw(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else if(r===W.date&&n===W.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function Eq(e,t){return new pa({values:e,typeName:fe.ZodEnum,...De(t)})}var vq=(e,t)=>{if(da(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Zr(e.common.issues);return this._error=r,this._error}}}},t$e,r$e,n$e,o$e,i$e,s$e,a$e,c$e,l$e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",gw,u$e,d$e,f$e,p$e,m$e,h$e,wq="((\\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])))",g$e,fi,Jc,Xc,Ch,md,kh,hd,gd,Rh,fa,pi,Ah,So,$t,yd,di=(e)=>{if(e instanceof xd)return di(e.schema);else if(e instanceof Co)return di(e.innerType());else if(e instanceof _d)return[e.value];else if(e instanceof pa)return e.options;else if(e instanceof vd)return Ne.objectValues(e.enum);else if(e instanceof wd)return di(e._def.innerType);else if(e instanceof hd)return[void 0];else if(e instanceof gd)return[null];else if(e instanceof $o)return[void 0,...di(e.unwrap())];else if(e instanceof bs)return[null,...di(e.unwrap())];else if(e instanceof xw)return di(e.unwrap());else if(e instanceof Ed)return di(e.unwrap());else if(e instanceof Dd)return di(e._def.innerType);else return[]},bw,bd,mi,Oh,Fh,Zc,pd,xd,_d,pa,vd,Qc,Co,$o,bs,wd,Dd,Ph,Jst,xw,Ih,Ed,Xst,fe,w,k,Zst,Qst,be,eat,tat,rat,nat,oat,Sd,iat,sat,te,U,aat,el,_w,cat,lat,ma,uat,dat,fat,pat,ze,Ze,mat,hat,gat,yat,bat,xat,_at;var Sq=O(()=>{Eh();Sh();_q();hw();ud();t$e=/^c[^\s-]{8,}$/i,r$e=/^[0-9a-z]+$/,n$e=/^[0-9A-HJKMNP-TV-Z]{26}$/i,o$e=/^[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,i$e=/^[a-z0-9_-]{21}$/i,s$e=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,a$e=/^[-+]?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)?)??$/,c$e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,u$e=/^(?:(?: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])$/,d$e=/^(?:(?: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])$/,f$e=/^(([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]))$/,p$e=/^(([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])$/,m$e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,h$e=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,g$e=new RegExp(`^${wq}$`);fi=class fi extends Fe{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==W.string){let o=this._getOrReturnCtx(e);return G(o,{code:M.invalid_type,expected:W.string,received:o.parsedType}),de}let r=new ir,n=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.length<o.value)n=this._getOrReturnCtx(e,n),G(n,{code:M.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="max"){if(e.data.length>o.value)n=this._getOrReturnCtx(e,n),G(n,{code:M.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="length"){let i=e.data.length>o.value,s=e.data.length<o.value;if(i||s){if(n=this._getOrReturnCtx(e,n),i)G(n,{code:M.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(s)G(n,{code:M.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});r.dirty()}}else if(o.kind==="email"){if(!c$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"email",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="emoji"){if(!gw)gw=new RegExp(l$e,"u");if(!gw.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"emoji",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="uuid"){if(!o$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"uuid",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="nanoid"){if(!i$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"nanoid",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cuid"){if(!t$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"cuid",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cuid2"){if(!r$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"cuid2",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="ulid"){if(!n$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"ulid",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),G(n,{validation:"url",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="regex"){if(o.regex.lastIndex=0,!o.regex.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"regex",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="trim")e.data=e.data.trim();else if(o.kind==="includes"){if(!e.data.includes(o.value,o.position))n=this._getOrReturnCtx(e,n),G(n,{code:M.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()}else if(o.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(o.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(o.kind==="startsWith"){if(!e.data.startsWith(o.value))n=this._getOrReturnCtx(e,n),G(n,{code:M.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()}else if(o.kind==="endsWith"){if(!e.data.endsWith(o.value))n=this._getOrReturnCtx(e,n),G(n,{code:M.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()}else if(o.kind==="datetime"){if(!b$e(o).test(e.data))n=this._getOrReturnCtx(e,n),G(n,{code:M.invalid_string,validation:"datetime",message:o.message}),r.dirty()}else if(o.kind==="date"){if(!g$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{code:M.invalid_string,validation:"date",message:o.message}),r.dirty()}else if(o.kind==="time"){if(!y$e(o).test(e.data))n=this._getOrReturnCtx(e,n),G(n,{code:M.invalid_string,validation:"time",message:o.message}),r.dirty()}else if(o.kind==="duration"){if(!a$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"duration",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="ip"){if(!x$e(e.data,o.version))n=this._getOrReturnCtx(e,n),G(n,{validation:"ip",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="jwt"){if(!_$e(e.data,o.alg))n=this._getOrReturnCtx(e,n),G(n,{validation:"jwt",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cidr"){if(!v$e(e.data,o.version))n=this._getOrReturnCtx(e,n),G(n,{validation:"cidr",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="base64"){if(!m$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"base64",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="base64url"){if(!h$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"base64url",code:M.invalid_string,message:o.message}),r.dirty()}else Ne.assertNever(o);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((n)=>e.test(n),{validation:t,code:M.invalid_string,...ne.errToObj(r)})}_addCheck(e){return new fi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ne.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ne.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ne.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ne.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ne.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ne.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ne.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ne.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ne.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ne.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ne.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ne.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ne.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...ne.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ne.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ne.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...ne.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...ne.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ne.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ne.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ne.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ne.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ne.errToObj(t)})}nonempty(e){return this.min(1,ne.errToObj(e))}trim(){return new fi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new fi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new fi({...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)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};fi.create=(e)=>new fi({checks:[],typeName:fe.ZodString,coerce:e?.coerce??!1,...De(e)});Jc=class Jc extends Fe{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);if(this._getType(e)!==W.number){let o=this._getOrReturnCtx(e);return G(o,{code:M.invalid_type,expected:W.number,received:o.parsedType}),de}let r=void 0,n=new ir;for(let o of this._def.checks)if(o.kind==="int"){if(!Ne.isInteger(e.data))r=this._getOrReturnCtx(e,r),G(r,{code:M.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()}else if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)r=this._getOrReturnCtx(e,r),G(r,{code:M.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)r=this._getOrReturnCtx(e,r),G(r,{code:M.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="multipleOf"){if(w$e(e.data,o.value)!==0)r=this._getOrReturnCtx(e,r),G(r,{code:M.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()}else if(o.kind==="finite"){if(!Number.isFinite(e.data))r=this._getOrReturnCtx(e,r),G(r,{code:M.not_finite,message:o.message}),n.dirty()}else Ne.assertNever(o);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ne.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ne.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ne.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ne.toString(t))}setLimit(e,t,r,n){return new Jc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ne.toString(n)}]})}_addCheck(e){return new Jc({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ne.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ne.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ne.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ne.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ne.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ne.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ne.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ne.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ne.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&Ne.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(t===null||r.value>t)t=r.value}else if(r.kind==="max"){if(e===null||r.value<e)e=r.value}return Number.isFinite(t)&&Number.isFinite(e)}};Jc.create=(e)=>new Jc({checks:[],typeName:fe.ZodNumber,coerce:e?.coerce||!1,...De(e)});Xc=class Xc extends Fe{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)!==W.bigint)return this._getInvalidInput(e);let r=void 0,n=new ir;for(let o of this._def.checks)if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)r=this._getOrReturnCtx(e,r),G(r,{code:M.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)r=this._getOrReturnCtx(e,r),G(r,{code:M.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()}else if(o.kind==="multipleOf"){if(e.data%o.value!==BigInt(0))r=this._getOrReturnCtx(e,r),G(r,{code:M.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()}else Ne.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return G(t,{code:M.invalid_type,expected:W.bigint,received:t.parsedType}),de}gte(e,t){return this.setLimit("min",e,!0,ne.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ne.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ne.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ne.toString(t))}setLimit(e,t,r,n){return new Xc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ne.toString(n)}]})}_addCheck(e){return new Xc({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ne.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ne.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ne.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ne.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ne.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};Xc.create=(e)=>new Xc({checks:[],typeName:fe.ZodBigInt,coerce:e?.coerce??!1,...De(e)});Ch=class Ch extends Fe{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==W.boolean){let r=this._getOrReturnCtx(e);return G(r,{code:M.invalid_type,expected:W.boolean,received:r.parsedType}),de}return br(e.data)}};Ch.create=(e)=>new Ch({typeName:fe.ZodBoolean,coerce:e?.coerce||!1,...De(e)});md=class md extends Fe{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==W.date){let o=this._getOrReturnCtx(e);return G(o,{code:M.invalid_type,expected:W.date,received:o.parsedType}),de}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return G(o,{code:M.invalid_date}),de}let r=new ir,n=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.getTime()<o.value)n=this._getOrReturnCtx(e,n),G(n,{code:M.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()}else if(o.kind==="max"){if(e.data.getTime()>o.value)n=this._getOrReturnCtx(e,n),G(n,{code:M.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()}else Ne.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new md({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ne.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ne.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(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)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}};md.create=(e)=>new md({checks:[],coerce:e?.coerce||!1,typeName:fe.ZodDate,...De(e)});kh=class kh extends Fe{_parse(e){if(this._getType(e)!==W.symbol){let r=this._getOrReturnCtx(e);return G(r,{code:M.invalid_type,expected:W.symbol,received:r.parsedType}),de}return br(e.data)}};kh.create=(e)=>new kh({typeName:fe.ZodSymbol,...De(e)});hd=class hd extends Fe{_parse(e){if(this._getType(e)!==W.undefined){let r=this._getOrReturnCtx(e);return G(r,{code:M.invalid_type,expected:W.undefined,received:r.parsedType}),de}return br(e.data)}};hd.create=(e)=>new hd({typeName:fe.ZodUndefined,...De(e)});gd=class gd extends Fe{_parse(e){if(this._getType(e)!==W.null){let r=this._getOrReturnCtx(e);return G(r,{code:M.invalid_type,expected:W.null,received:r.parsedType}),de}return br(e.data)}};gd.create=(e)=>new gd({typeName:fe.ZodNull,...De(e)});Rh=class Rh extends Fe{constructor(){super(...arguments);this._any=!0}_parse(e){return br(e.data)}};Rh.create=(e)=>new Rh({typeName:fe.ZodAny,...De(e)});fa=class fa extends Fe{constructor(){super(...arguments);this._unknown=!0}_parse(e){return br(e.data)}};fa.create=(e)=>new fa({typeName:fe.ZodUnknown,...De(e)});pi=class pi extends Fe{_parse(e){let t=this._getOrReturnCtx(e);return G(t,{code:M.invalid_type,expected:W.never,received:t.parsedType}),de}};pi.create=(e)=>new pi({typeName:fe.ZodNever,...De(e)});Ah=class Ah extends Fe{_parse(e){if(this._getType(e)!==W.undefined){let r=this._getOrReturnCtx(e);return G(r,{code:M.invalid_type,expected:W.void,received:r.parsedType}),de}return br(e.data)}};Ah.create=(e)=>new Ah({typeName:fe.ZodVoid,...De(e)});So=class So extends Fe{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==W.array)return G(t,{code:M.invalid_type,expected:W.array,received:t.parsedType}),de;if(n.exactLength!==null){let i=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;if(i||s)G(t,{code:i?M.too_big:M.too_small,minimum:s?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty()}if(n.minLength!==null){if(t.data.length<n.minLength.value)G(t,{code:M.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()}if(n.maxLength!==null){if(t.data.length>n.maxLength.value)G(t,{code:M.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()}if(t.common.async)return Promise.all([...t.data].map((i,s)=>n.type._parseAsync(new Ln(t,i,t.path,s)))).then((i)=>ir.mergeArray(r,i));let o=[...t.data].map((i,s)=>n.type._parseSync(new Ln(t,i,t.path,s)));return ir.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new So({...this._def,minLength:{value:e,message:ne.toString(t)}})}max(e,t){return new So({...this._def,maxLength:{value:e,message:ne.toString(t)}})}length(e,t){return new So({...this._def,exactLength:{value:e,message:ne.toString(t)}})}nonempty(e){return this.min(1,e)}};So.create=(e,t)=>new So({type:e,minLength:null,maxLength:null,exactLength:null,typeName:fe.ZodArray,...De(t)});$t=class $t extends Fe{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=Ne.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==W.object){let c=this._getOrReturnCtx(e);return G(c,{code:M.invalid_type,expected:W.object,received:c.parsedType}),de}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof pi&&this._def.unknownKeys==="strip")){for(let c in n.data)if(!i.includes(c))s.push(c)}let a=[];for(let c of i){let u=o[c],d=n.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new Ln(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof pi){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of s)a.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict"){if(s.length>0)G(n,{code:M.unrecognized_keys,keys:s}),r.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of s){let d=n.data[u];a.push({key:{status:"valid",value:u},value:c._parse(new Ln(n,d,n.path,u)),alwaysSet:u in n.data})}}if(n.common.async)return Promise.resolve().then(async()=>{let c=[];for(let u of a){let d=await u.key,f=await u.value;c.push({key:d,value:f,alwaysSet:u.alwaysSet})}return c}).then((c)=>ir.mergeObjectSync(r,c));else return ir.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(e){return ne.errToObj,new $t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;if(t.code==="unrecognized_keys")return{message:ne.errToObj(e).message??n};return{message:n}}}:{}})}strip(){return new $t({...this._def,unknownKeys:"strip"})}passthrough(){return new $t({...this._def,unknownKeys:"passthrough"})}extend(e){return new $t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new $t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:fe.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new $t({...this._def,catchall:e})}pick(e){let t={};for(let r of Ne.objectKeys(e))if(e[r]&&this.shape[r])t[r]=this.shape[r];return new $t({...this._def,shape:()=>t})}omit(e){let t={};for(let r of Ne.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new $t({...this._def,shape:()=>t})}deepPartial(){return Yc(this)}partial(e){let t={};for(let r of Ne.objectKeys(this.shape)){let n=this.shape[r];if(e&&!e[r])t[r]=n;else t[r]=n.optional()}return new $t({...this._def,shape:()=>t})}required(e){let t={};for(let r of Ne.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let o=this.shape[r];while(o instanceof $o)o=o._def.innerType;t[r]=o}return new $t({...this._def,shape:()=>t})}keyof(){return Eq(Ne.objectKeys(this.shape))}};$t.create=(e,t)=>new $t({shape:()=>e,unknownKeys:"strip",catchall:pi.create(),typeName:fe.ZodObject,...De(t)});$t.strictCreate=(e,t)=>new $t({shape:()=>e,unknownKeys:"strict",catchall:pi.create(),typeName:fe.ZodObject,...De(t)});$t.lazycreate=(e,t)=>new $t({shape:e,unknownKeys:"strip",catchall:pi.create(),typeName:fe.ZodObject,...De(t)});yd=class yd extends Fe{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;let i=o.map((s)=>new Zr(s.ctx.common.issues));return G(t,{code:M.invalid_union,unionErrors:i}),de}if(t.common.async)return Promise.all(r.map(async(o)=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);else{let o=void 0,i=[];for(let a of r){let c={...t,common:{...t.common,issues:[]},parent:null},u=a._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;else if(u.status==="dirty"&&!o)o={result:u,ctx:c};if(c.common.issues.length)i.push(c.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map((a)=>new Zr(a));return G(t,{code:M.invalid_union,unionErrors:s}),de}}get options(){return this._def.options}};yd.create=(e,t)=>new yd({options:e,typeName:fe.ZodUnion,...De(t)});bw=class bw extends Fe{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.object)return G(t,{code:M.invalid_type,expected:W.object,received:t.parsedType}),de;let r=this.discriminator,n=t.data[r],o=this.optionsMap.get(n);if(!o)return G(t,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),de;if(t.common.async)return o._parseAsync({data:t.data,path:t.path,parent:t});else return o._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let o of t){let i=di(o.shape[e]);if(!i.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of i){if(n.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,o)}}return new bw({typeName:fe.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...De(r)})}};bd=class bd extends Fe{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(pw(o)||pw(i))return de;let s=yw(o.value,i.value);if(!s.valid)return G(r,{code:M.invalid_intersection_types}),de;if(mw(o)||mw(i))t.dirty();return{status:t.value,value:s.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>n(o,i));else return n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};bd.create=(e,t,r)=>new bd({left:e,right:t,typeName:fe.ZodIntersection,...De(r)});mi=class mi extends Fe{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==W.array)return G(r,{code:M.invalid_type,expected:W.array,received:r.parsedType}),de;if(r.data.length<this._def.items.length)return G(r,{code:M.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),de;if(!this._def.rest&&r.data.length>this._def.items.length)G(r,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let o=[...r.data].map((i,s)=>{let a=this._def.items[s]||this._def.rest;if(!a)return null;return a._parse(new Ln(r,i,r.path,s))}).filter((i)=>!!i);if(r.common.async)return Promise.all(o).then((i)=>ir.mergeArray(t,i));else return ir.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new mi({...this._def,rest:e})}};mi.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new mi({items:e,typeName:fe.ZodTuple,rest:null,...De(t)})};Oh=class Oh extends Fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==W.object)return G(r,{code:M.invalid_type,expected:W.object,received:r.parsedType}),de;let n=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)n.push({key:o._parse(new Ln(r,s,r.path,s)),value:i._parse(new Ln(r,r.data[s],r.path,s)),alwaysSet:s in r.data});if(r.common.async)return ir.mergeObjectAsync(t,n);else return ir.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof Fe)return new Oh({keyType:e,valueType:t,typeName:fe.ZodRecord,...De(r)});return new Oh({keyType:fi.create(),valueType:e,typeName:fe.ZodRecord,...De(t)})}};Fh=class Fh extends Fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==W.map)return G(r,{code:M.invalid_type,expected:W.map,received:r.parsedType}),de;let n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,a],c)=>({key:n._parse(new Ln(r,s,r.path,[c,"key"])),value:o._parse(new Ln(r,a,r.path,[c,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let a of i){let c=await a.key,u=await a.value;if(c.status==="aborted"||u.status==="aborted")return de;if(c.status==="dirty"||u.status==="dirty")t.dirty();s.set(c.value,u.value)}return{status:t.value,value:s}})}else{let s=new Map;for(let a of i){let{key:c,value:u}=a;if(c.status==="aborted"||u.status==="aborted")return de;if(c.status==="dirty"||u.status==="dirty")t.dirty();s.set(c.value,u.value)}return{status:t.value,value:s}}}};Fh.create=(e,t,r)=>new Fh({valueType:t,keyType:e,typeName:fe.ZodMap,...De(r)});Zc=class Zc extends Fe{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==W.set)return G(r,{code:M.invalid_type,expected:W.set,received:r.parsedType}),de;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)G(r,{code:M.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()}if(n.maxSize!==null){if(r.data.size>n.maxSize.value)G(r,{code:M.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty()}let o=this._def.valueType;function i(a){let c=new Set;for(let u of a){if(u.status==="aborted")return de;if(u.status==="dirty")t.dirty();c.add(u.value)}return{status:t.value,value:c}}let s=[...r.data.values()].map((a,c)=>o._parse(new Ln(r,a,r.path,c)));if(r.common.async)return Promise.all(s).then((a)=>i(a));else return i(s)}min(e,t){return new Zc({...this._def,minSize:{value:e,message:ne.toString(t)}})}max(e,t){return new Zc({...this._def,maxSize:{value:e,message:ne.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Zc.create=(e,t)=>new Zc({valueType:e,minSize:null,maxSize:null,typeName:fe.ZodSet,...De(t)});pd=class pd extends Fe{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.function)return G(t,{code:M.invalid_type,expected:W.function,received:t.parsedType}),de;function r(s,a){return $h({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,dd(),ys].filter((c)=>!!c),issueData:{code:M.invalid_arguments,argumentsError:a}})}function n(s,a){return $h({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,dd(),ys].filter((c)=>!!c),issueData:{code:M.invalid_return_type,returnTypeError:a}})}let o={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Qc){let s=this;return br(async function(...a){let c=new Zr([]),u=await s._def.args.parseAsync(a,o).catch((m)=>{throw c.addIssue(r(a,m)),c}),d=await Reflect.apply(i,this,u);return await s._def.returns._def.type.parseAsync(d,o).catch((m)=>{throw c.addIssue(n(d,m)),c})})}else{let s=this;return br(function(...a){let c=s._def.args.safeParse(a,o);if(!c.success)throw new Zr([r(a,c.error)]);let u=Reflect.apply(i,this,c.data),d=s._def.returns.safeParse(u,o);if(!d.success)throw new Zr([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new pd({...this._def,args:mi.create(e).rest(fa.create())})}returns(e){return new pd({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new pd({args:e?e:mi.create([]).rest(fa.create()),returns:t||fa.create(),typeName:fe.ZodFunction,...De(r)})}};xd=class xd extends Fe{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})}};xd.create=(e,t)=>new xd({getter:e,typeName:fe.ZodLazy,...De(t)});_d=class _d extends Fe{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return G(t,{received:t.data,code:M.invalid_literal,expected:this._def.value}),de}return{status:"valid",value:e.data}}get value(){return this._def.value}};_d.create=(e,t)=>new _d({value:e,typeName:fe.ZodLiteral,...De(t)});pa=class pa extends Fe{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return G(t,{expected:Ne.joinValues(r),received:t.parsedType,code:M.invalid_type}),de}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return G(t,{received:t.data,code:M.invalid_enum_value,options:r}),de}return br(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 pa.create(e,{...this._def,...t})}exclude(e,t=this._def){return pa.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};pa.create=Eq;vd=class vd extends Fe{_parse(e){let t=Ne.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==W.string&&r.parsedType!==W.number){let n=Ne.objectValues(t);return G(r,{expected:Ne.joinValues(n),received:r.parsedType,code:M.invalid_type}),de}if(!this._cache)this._cache=new Set(Ne.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=Ne.objectValues(t);return G(r,{received:r.data,code:M.invalid_enum_value,options:n}),de}return br(e.data)}get enum(){return this._def.values}};vd.create=(e,t)=>new vd({values:e,typeName:fe.ZodNativeEnum,...De(t)});Qc=class Qc extends Fe{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.promise&&t.common.async===!1)return G(t,{code:M.invalid_type,expected:W.promise,received:t.parsedType}),de;let r=t.parsedType===W.promise?t.data:Promise.resolve(t.data);return br(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Qc.create=(e,t)=>new Qc({type:e,typeName:fe.ZodPromise,...De(t)});Co=class Co extends Fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===fe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:(i)=>{if(G(r,i),i.fatal)t.abort();else t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let i=n.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async(s)=>{if(t.value==="aborted")return de;let a=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});if(a.status==="aborted")return de;if(a.status==="dirty")return Kc(a.value);if(t.value==="dirty")return Kc(a.value);return a});else{if(t.value==="aborted")return de;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});if(s.status==="aborted")return de;if(s.status==="dirty")return Kc(s.value);if(t.value==="dirty")return Kc(s.value);return s}}if(n.type==="refinement"){let i=(s)=>{let a=n.refinement(s,o);if(r.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(s.status==="aborted")return de;if(s.status==="dirty")t.dirty();return i(s.value),{status:t.value,value:s.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((s)=>{if(s.status==="aborted")return de;if(s.status==="dirty")t.dirty();return i(s.value).then(()=>({status:t.value,value:s.value}))})}if(n.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!da(i))return de;let s=n.transform(i.value,o);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((i)=>{if(!da(i))return de;return Promise.resolve(n.transform(i.value,o)).then((s)=>({status:t.value,value:s}))});Ne.assertNever(n)}};Co.create=(e,t,r)=>new Co({schema:e,typeName:fe.ZodEffects,effect:t,...De(r)});Co.createWithPreprocess=(e,t,r)=>new Co({schema:t,effect:{type:"preprocess",transform:e},typeName:fe.ZodEffects,...De(r)});$o=class $o extends Fe{_parse(e){if(this._getType(e)===W.undefined)return br(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};$o.create=(e,t)=>new $o({innerType:e,typeName:fe.ZodOptional,...De(t)});bs=class bs extends Fe{_parse(e){if(this._getType(e)===W.null)return br(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};bs.create=(e,t)=>new bs({innerType:e,typeName:fe.ZodNullable,...De(t)});wd=class wd extends Fe{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===W.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};wd.create=(e,t)=>new wd({innerType:e,typeName:fe.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...De(t)});Dd=class Dd extends Fe{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(fd(n))return n.then((o)=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Zr(r.common.issues)},input:r.data})}));else return{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Zr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Dd.create=(e,t)=>new Dd({innerType:e,typeName:fe.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...De(t)});Ph=class Ph extends Fe{_parse(e){if(this._getType(e)!==W.nan){let r=this._getOrReturnCtx(e);return G(r,{code:M.invalid_type,expected:W.nan,received:r.parsedType}),de}return{status:"valid",value:e.data}}};Ph.create=(e)=>new Ph({typeName:fe.ZodNaN,...De(e)});Jst=Symbol("zod_brand");xw=class xw extends Fe{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}};Ih=class Ih extends Fe{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(o.status==="aborted")return de;if(o.status==="dirty")return t.dirty(),Kc(o.value);else return this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();else{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(n.status==="aborted")return de;if(n.status==="dirty")return t.dirty(),{status:"dirty",value:n.value};else return this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new Ih({in:e,out:t,typeName:fe.ZodPipeline})}};Ed=class Ed extends Fe{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(da(n))n.value=Object.freeze(n.value);return n};return fd(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};Ed.create=(e,t)=>new Ed({innerType:e,typeName:fe.ZodReadonly,...De(t)});Xst={object:$t.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(fe||(fe={}));w=fi.create,k=Jc.create,Zst=Ph.create,Qst=Xc.create,be=Ch.create,eat=md.create,tat=kh.create,rat=hd.create,nat=gd.create,oat=Rh.create,Sd=fa.create,iat=pi.create,sat=Ah.create,te=So.create,U=$t.create,aat=$t.strictCreate,el=yd.create,_w=bw.create,cat=bd.create,lat=mi.create,ma=Oh.create,uat=Fh.create,dat=Zc.create,fat=pd.create,pat=xd.create,ze=_d.create,Ze=pa.create,mat=vd.create,hat=Qc.create,gat=Co.create,yat=$o.create,bat=bs.create,xat=Co.createWithPreprocess,_at=Ih.create});var vw=O(()=>{Sh();hw();xq();ud();Sq();Eh()});var en=O(()=>{vw();vw()});function S$e(e){return e.startsWith("v")?e:`v${e}`}var D$e,E$e,$q,Oat;var ww=O(()=>{en();D$e=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,E$e=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;$q=w().regex(D$e,"must be a semver version, optionally v-prefixed").transform(S$e),Oat=w().regex(E$e,"must be the canonical v-prefixed tag (vX.Y.Z)")});function Dw(e){return Th.includes(e)}var $$e,$d,Th,Cq,C$e,kq,k$e,Rq,R$e,A$e,Aq,O$e,Oq,Iat,Tat,Fq,F$e,Pq,P$e,Iq,Ew=20,Sw=500,I$e,Nat;var Cd=O(()=>{en();$$e=Ze(["pending","verified","approved","revoked"]),$d=Ze(["person","service","test"]),Th=$d.options;Cq={nemarOwner:"service",nemarAdmin:"service","test-admin":"service","test-owner":"service","cool-vibers":"test","test-user":"test","test-pending":"test","test-verified":"test","test-revoked":"test"},C$e=Ze(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),kq=C$e.options,k$e=Ze(["active","pending","revoked"]),Rq=U({field:w(),blocks:te(w()).optional(),set_on:te(w()).optional()}).passthrough(),R$e=U({id:k().int(),username:w().nullable(),email:w(),github_username:w().nullable(),role:w(),orcid:w().nullable().optional(),created_at:w().optional(),approved_at:w().nullable().optional(),dataset_count:k().int().optional(),sandbox_completed:be().optional(),sandbox_completed_at:w().nullable().optional(),sandbox_dataset_id:w().nullable().optional(),service_access:be().optional(),status:$$e.optional(),email_verified:be().optional(),orcid_verified:be().optional(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),profile_gaps:te(Rq).optional(),username_auto_assigned:be().optional(),account_kind:$d.optional()}).passthrough(),A$e=U({prefix:w(),created_at:w(),last_used_at:w().nullable()}).passthrough().nullable(),Aq=U({user:R$e,token:A$e.optional()}).passthrough(),O$e=U({id:k().int(),username:w().nullable(),email:w(),github_username:w().nullable(),status:w(),email_verified:k().int().nullable().optional(),role:w().nullable(),created_at:w(),approved_at:w().nullable().optional(),revoked_at:w().nullable().optional(),signup_source:w().nullable().optional(),service_access:k().int().nullable().optional(),service_access_granted_at:w().nullable().optional(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),orcid:w().nullable().optional(),upload_access_requested_at:w().nullable().optional(),account_kind:$d.optional()}).passthrough(),Oq=U({users:te(O$e),count:k().int()}).passthrough(),Iat=Ze(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),Tat=Ze(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),Fq=U({suggestion:w().nullable(),based_on:Ze(["name","unavailable","exhausted"])}).passthrough(),F$e=Ze(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),Pq=F$e.options,P$e=Ze(["invalid_github_username","city_required","country_required","empty_patch","username_too_short","username_too_long","username_charset","given_name_required","family_name_required","username_taken","username_locked","name_is_orcid_canonical","account_revoked","github_unavailable","same_email","code_expired","code_incorrect","orcid_already_have","orcid_unavailable"]),Iq=P$e.options,I$e=U({id:k().int(),email:w(),username:w().nullable(),role:w(),status:k$e,email_verified:be(),given_name:w().nullable(),family_name:w().nullable(),orcid:w().nullable(),orcid_verified:be(),github_username:w().nullable(),city:w().nullable(),country:w().nullable(),affiliation:w().nullable(),service_access:be(),service_access_granted_at:w().nullable(),upload_access_requested_at:w().nullable(),profile_gaps:te(Rq),username_auto_assigned:be()}).passthrough(),Nat=U({user:I$e.nullable()}).passthrough()});function Nq(e,t){if(e.zarr_index_url!=null&&e.zarr_status!=="ready")t.addIssue({code:M.custom,message:"zarr_index_url must be null/absent unless zarr_status is 'ready'",path:["zarr_index_url"]})}function jq(e,t){if(e.zarr_verified_at!=null&&e.zarr_verify_status==null)t.addIssue({code:M.custom,message:"zarr_verified_at must be null/absent unless zarr_verify_status is non-null",path:["zarr_verified_at"]})}var T$e="0.4.0",$w,tl,Tq,N$e,j$e,q$e,qq,Lat,Mq,Bat,hi,M$e,Nh,Uat;var Cw=O(()=>{en();ww();$w=Ze(["openneuro","nemar","gin","other"]),tl=el([ze(0),ze(1)]).nullable(),Tq=U({dataset_id:w(),id:w().optional(),name:w(),description:w().nullable().optional(),status:w(),visibility:w(),anonymous:k().int().nullable().optional(),concept_doi:w().nullable().optional(),doi:w().nullable().optional(),created_at:w(),updated_at:w().optional(),first_published_at:w().nullable().optional(),owner_username:w().nullable().optional(),source:w().nullable().optional(),modalities:w().optional(),participants:k().int().nonnegative(),tasks:w().optional(),authors:w().optional(),license:w().optional(),file_size:k().nonnegative(),file_size_formatted:w().optional(),total_files:k().nonnegative().nullable().optional(),num_citations:k().int().nonnegative().optional(),n_channels:k().int().nullable().optional(),electrode_system:w().nullable().optional(),has_hed:tl.optional(),hed_version:w().nullable().optional(),data_complete:tl.optional(),bytes_present:k().nonnegative().nullable().optional(),latest_version:$q.nullable().optional(),subject_count:k().int().nullable().optional(),file_size_bytes:k().nullable().optional(),sessions_count:k().int().nullable().optional(),age_min:k().nullable().optional(),age_max:k().nullable().optional(),bids_version:w().nullable().optional(),zarr_status:Ze(["pending","ready","failed"]).nullable().optional(),zarr_store_count:k().int().nullable().optional(),zarr_converted_at:w().nullable().optional(),zarr_source_commit:w().nullable().optional(),zarr_errors:k().int().nullable().optional(),zarr_failure_count:k().int().nullable().optional(),zarr_deterministic:tl.optional(),zarr_failed_at:w().nullable().optional(),zarr_index_url:w().nullable().optional(),zarr_verify_status:Ze(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:w().nullable().optional(),zarr_requeue_at:w().nullable().optional(),anonymity_status:Ze(["verified","findings","unverifiable"]).nullable().optional(),anonymity_checked_at:w().nullable().optional(),anonymity_findings:w().nullable().optional(),anonymity_unchecked:w().nullable().optional(),total_recording_duration:k().nullable().optional(),recording_duration_min:k().nullable().optional(),recording_duration_max:k().nullable().optional(),recording_count:k().int().nullable().optional(),recordings_unavailable:k().int().nullable().optional(),channel_count_min:k().int().nullable().optional(),channel_count_max:k().int().nullable().optional(),sampling_frequency:k().nullable().optional(),power_line_frequency:k().nullable().optional(),eeg_reference:w().nullable().optional(),placement_scheme:w().nullable().optional()}).passthrough();N$e=Tq.superRefine((e,t)=>{Nq(e,t),jq(e,t)}),j$e=Tq.extend({file_size:k().nonnegative().nullable(),file_size_formatted:w().nullable().optional(),modalities:w().nullable().optional(),tasks:w().nullable().optional(),authors:w().nullable().optional(),license:w().nullable().optional(),owner_github:w().nullable().optional(),attestation_deposit_type:Ze(["owner","redistribution"]).nullable().optional(),attestation_key_status:Ze(["destroyed","retained"]).nullable().optional(),attestation_deidentified:tl.optional(),attestation_no_duplicate:tl.optional(),attestation_upstream_source:w().nullable().optional(),attestation_accepted_at:w().nullable().optional(),zarr_data_failures:U({count:k().int().nonnegative(),detail_ref:w(),compacted_by:w().optional(),pending:k().int().nonnegative().optional(),discovered:k().int().nonnegative().optional(),events_upload_failed:ze(!0).optional(),manifest_upload_failed:ze(!0).optional()}).passthrough().nullable().optional()}).passthrough().superRefine((e,t)=>{Nq(e,t),jq(e,t)}),q$e=U({id:w(),name:w(),modalities:w().nullable().optional(),participants:k().int().nullable().optional(),doi:w().nullable().optional(),tasks:w().nullable().optional(),authors:w().nullable().optional(),has_hed:tl.optional(),score:k().optional(),snippet:w().optional()}).passthrough(),qq=ma(w(),k().int().nonnegative()),Lat=U({datasets:te(N$e),count:k().int().nonnegative(),total_count:k().int().nonnegative().optional(),limit:k().int().optional(),offset:k().int().optional(),excluded_unknown:k().int().nonnegative().optional(),excluded_unknown_by_facet:qq.optional()}).passthrough(),Mq=U({results:te(q$e),count:k().int().nonnegative(),returned:k().int().nonnegative().optional(),offset:k().int().nonnegative().optional(),limit:k().int().optional(),candidate_ceiling:k().int().optional(),truncated:be().optional(),method:Ze(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:k().optional(),warning:w().optional(),excluded_unknown:k().int().nonnegative().optional(),excluded_unknown_by_facet:qq.optional()}).passthrough(),Bat=U({dataset:j$e}).passthrough(),hi=U({value:w(),count:k().int().nonnegative()}),M$e=U({values:te(hi),distinct_total:k().int().nonnegative(),truncated:be()}),Nh=U({"electrode-system":te(hi).optional(),source:te(hi).optional(),zarr:te(hi).optional(),powerline:te(hi).optional(),"bids-version":te(hi).optional(),"hed-version":te(hi).optional(),license:te(hi).optional(),modality:te(hi).optional(),task:M$e.optional(),warning:w().optional()}).passthrough(),Uat=U({schema_version:ze(T$e),doc_type:ze("dataset"),dataset_id:w().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:w(),source:$w,recording_modality:te(w()).min(1),description:w().nullable().optional(),bids_version:w().nullable().optional(),license:w().nullable().optional()}).passthrough()});var L$e,Gat,Hat,Wat,Kat;var Lq=O(()=>{en();L$e=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,Gat=w().regex(L$e,"ORCID must be in format 0000-0000-0000-000X"),Hat=Ze(["found","no_public_name","lookup_failed"]),Wat=Ze(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing"]),Kat=Ze(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var B$e,Bq,kd="https://nemar.org/settings",Xat,U$e,z$e,V$e,Uq,zq;var kw=O(()=>{en();B$e=Ze(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),Bq=B$e.options,Xat={orcid_in_use:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${kd}).`,orcid_already_linked:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${kd}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${kd}), then link it here.`,email_in_use:`That email address already belongs to a NEMAR account. Sign in to that account instead, or change its address first (Settings, ${kd}).`,github_in_use:`That GitHub account is already linked to a NEMAR account. Sign in to that account instead, or change its GitHub username first (Settings, ${kd}).`,identity_conflict_remains:"The collision that flagged this account is still there. Resolve it on the other account first (change its email or GitHub username, or unlink its ORCID iD), or delete that account, then clear the flag."},U$e=Ze(["orcid","email","github"]),z$e=U({id:k().int(),username:w().nullable(),email:w(),created_at:w(),has_oauth_identity:be(),dataset_count:k().int(),identity_conflict:k().int(),canonical:be()}).passthrough(),V$e=U({kind:U$e,value:w(),canonical_user_id:k().int(),accounts:te(z$e)}).passthrough(),Uq=U({groups:te(V$e),group_count:k().int(),flagged_count:k().int()}).passthrough(),zq=U({ok:ze(!0),id:k().int(),cleared:be()}).passthrough()});var Rw=120,Vq=64,Aw="unnamed machine",G$e=25,jh,Gq,rl,Hq,ect,tct,Wq,H$e,W$e,Kq,Ow,Yq,rct,nct,qh,Mh;var Lh=O(()=>{en();jh=Ze(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),Gq={authorization_pending:"Waiting for you to authorize this machine in the browser.",slow_down:"Polling too quickly; the CLI will slow down automatically.",expired_token:"The code expired. Run `nemar auth login` again for a new one.",access_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",invalid_grant:"That code is no longer valid. Run `nemar auth login` again for a new one."},rl=Ze(["device_code_unknown","device_code_expired","device_code_used","device_code_denied","account_pending","account_revoked","identity_conflict","service_account","person_account","too_many_keys","key_not_found"]),Hq=rl.options,ect={device_code_unknown:"That code was not found. Check the code shown in your terminal, or run `nemar auth login` again for a new one.",device_code_expired:"The code expired. Run `nemar auth login` again for a new one.",device_code_used:"That code has already been used. Run `nemar auth login` again for a new one.",device_code_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",account_pending:"Verify your email address first. Check your inbox for the NEMAR verification code, then authorize again.",account_revoked:"Your NEMAR account access has been revoked. Contact the NEMAR team if you think this is a mistake.",identity_conflict:"This account shares an identifier with another NEMAR account and cannot sign in until that is resolved. Fix it in Settings on nemar.org or contact the NEMAR team.",service_account:"This is a service or test account, and it cannot sign in this way. Ask an owner to create a key for it with `nemar admin keys create`.",person_account:"This account belongs to a person. A person creates their own keys with `nemar auth login` or in Settings on nemar.org.",too_many_keys:`This account already has ${G$e} active keys. Revoke one in Settings on nemar.org or with \`nemar auth keys\`, then try again.`,key_not_found:"That key was not found on this account, or it is already revoked. Run `nemar auth keys` to see the active ones."},tct=U({error:rl,message:w()}).passthrough(),Wq=U({device_code:w(),user_code:w(),verification_uri:w(),verification_uri_complete:w(),expires_in:k().int(),interval:k().int()}).passthrough(),H$e=_w("error",[U({error:ze("authorization_pending"),message:w()}).passthrough(),U({error:ze("slow_down"),message:w()}).passthrough()]),W$e=_w("error",[U({error:ze("expired_token"),reason:rl,message:w()}).passthrough(),U({error:ze("access_denied"),reason:rl,message:w()}).passthrough(),U({error:ze("invalid_grant"),reason:rl,message:w()}).passthrough()]),Kq=el([H$e,W$e]),Ow=U({id:k().int(),name:w().nullable(),prefix:w(),created_at:w(),last_used_at:w().nullable(),current:be()}).passthrough(),Yq=U({api_key:w(),key:Ow,user:U({username:w().nullable(),email:w(),github_username:w().nullable(),role:w(),sandbox_completed:be(),sandbox_dataset_id:w().nullable()}).passthrough()}).passthrough(),rct=U({user_code:w(),machine_name:w(),requested_at:w(),expires_in:k().int(),account:U({username:w().nullable(),email_masked:w()}).passthrough(),refusal:U({code:rl,message:w()}).passthrough().nullable()}).passthrough(),nct=U({ok:ze(!0),machine_name:w()}).passthrough(),qh=U({keys:te(Ow)}).passthrough(),Mh=U({api_key:w(),key:Ow}).passthrough()});function Pt(e){return Ct[e]}function gi(e,t){return e.replace(/\{(\w+)\}/g,(r,n)=>Object.hasOwn(t,n)?t[n]:r)}var Ct;var nl=O(()=>{Ct={"tier.unverified.label":"Email not verified","tier.base.label":"Base access","tier.upload.label":"Upload access","tier.unverified.lede":"Verify your email address to activate your account.","upload_access.section.title":"Upload access","upload_access.section.lede":"A one-time admin grant. Reviewed against export-control and local-jurisdiction rules.","upload_access.state.granted":"Granted","upload_access.state.requested":"Requested","upload_access.state.not_requested":"Not requested","upload_access.invite.title":"Want to contribute a dataset?","upload_access.invite.body":"Browsing, searching and downloading are open to your account already. Uploading needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once.","upload_access.gate.title":"Ask for upload access first","upload_access.gate.body":"Your account can browse, search and download everything public already. Uploading needs one extra grant: an admin checks your GitHub handle and where you\u2019re based against export-control and local-jurisdiction rules. You ask once, and it is answered by email.","upload_access.request.cta":"Request upload access","upload_access.request.form_body":"Tell us what you plan to deposit. An admin reviews this alongside your name, username, GitHub handle and location, then grants access once.","upload_access.request.why_label":"What do you intend to upload?","upload_access.request.why_hint":"Describe what you intend to upload in 20-500 characters","upload_access.requested.title":"Your request is with an admin","upload_access.requested.lede":"An admin is reviewing your request.","upload_access.requested.lede_dated":"An admin is reviewing your request from {date}.","upload_access.requested.body.upload":"We\u2019ll email you when there\u2019s a decision, and this page will let you upload as soon as it\u2019s granted.","upload_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","upload_access.requested.cta":"See the request","upload_access.granted.body":"You can upload datasets from the upload page. Publishing one is a separate, per-dataset review you start from your dashboard.","upload_access.unverified.body":"Verify your email address first \u2014 the review happens over email.","upload_access.docs_link":"How upload access works","gap.sentence":"{label} is missing: needed {blocks}.","gap.set_on.both":"Set it in {web} or run `{cli}`.","gap.set_on.web":"Set it in {web}.","gap.blocks.verified":"to activate your account","gap.blocks.upload_access":"to request upload access","gap.blocks.publication":"to publish a dataset","gap.blocks.unknown":"to finish setting up your account","gap.blocks.noun.verified":"account activation","gap.blocks.noun.upload_access":"upload access","gap.blocks.noun.publication":"publication","gap.set_on.default_web":"Settings","gap.field.email_verified.label":"A verified email address","gap.field.username.label":"Username","gap.field.given_name.label":"Given name","gap.field.family_name.label":"Family name","gap.field.orcid_verified.label":"Verified ORCID iD","gap.field.github_username.label":"GitHub handle","gap.field.city.label":"City","gap.field.country.label":"Country","gap.field.why.label":"A description of what you intend to upload","gap.field.email_verified.set_on.web":"the verify step on your dashboard","gap.field.email_verified.set_on.cli":"nemar auth resend-verification","gap.field.username.set_on.web":"Settings","gap.field.username.set_on.cli":"nemar auth profile set-username","gap.field.given_name.set_on.web":"Settings","gap.field.given_name.set_on.cli":"nemar auth profile set-name","gap.field.family_name.set_on.web":"Settings","gap.field.family_name.set_on.cli":"nemar auth profile set-name","gap.field.given_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.family_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.orcid_verified.set_on.web":"Settings","gap.field.orcid_verified.set_on.cli":"nemar auth profile orcid link","gap.field.github_username.set_on.web":"Settings","gap.field.github_username.set_on.cli":"nemar auth profile set-github","gap.field.city.set_on.web":"Settings","gap.field.city.set_on.cli":"nemar auth profile set-location","gap.field.country.set_on.web":"Settings","gap.field.country.set_on.cli":"nemar auth profile set-location","gap.field.why.set_on.web":"the request form in Settings","gap.field.why.set_on.cli":"nemar auth request-upload-access","gaps.title":"What is still missing","gaps.none":"Nothing outstanding \u2014 every field NEMAR needs is filled in.","gaps.nudge.title":"Your profile isn\u2019t finished yet","gaps.nudge.cta":"Complete your profile","gaps.upload.title":"Before you can ask, your account still needs:","gaps.request.title":"Finish these first:","gaps.admin.title":"Still missing","gaps.admin.item":"{label} \u2014 blocks {blocks}","gaps.admin.none":"Nothing missing \u2014 every field the request needs is filled in.","gaps.admin.not_loaded":"Not loaded \u2014 open the user page to see what is still missing.","onboarding.username.auto_assigned.title":"We chose your username from your name","onboarding.username.auto_assigned.body":"Your account needed a username to be listed as a dataset owner, so one was made from your name when you signed in. You can change it once, here, until an admin grants you upload access.","welcome.unverified.title":"Verify your email address","welcome.unverified.body":"Authorizing with ORCID created your NEMAR account and signed you in. One step left: enter the 6-digit code we emailed you. That activates the account \u2014 no admin approval is involved.","welcome.active.title":"Your account is active","welcome.active.body":"Authorizing with ORCID created your NEMAR account and signed you in. There is no separate sign-up step and no approval queue: browse, search, and your dashboard all work right now.","welcome.upload_access.title":"Ask for upload access when you\u2019re ready to contribute","welcome.upload_access.body":"Reading is open to every verified account. Uploading and compute need one extra grant, because an admin has to check your GitHub handle and location against export-control and local-jurisdiction rules first. You ask once, from Settings.","cli.gaps.section.title":"Profile","cli.gaps.unknown":"not checked: run 'nemar auth status --refresh'","cli.gaps.unreported":"not reported by this backend","cli.gap.set_on.cli_only":"Run `{cli}`.","cli.gap.field.sandbox.label":"Sandbox training","cli.gap.blocks.sandbox":"to upload a dataset from the CLI","cli.gap.field.sandbox.set_on.cli":"nemar sandbox","cli.gaps.sandbox_unchecked":"Sandbox training could not be confirmed with the server. Run `nemar sandbox status --refresh`, then `nemar sandbox` if it is still outstanding.","cli.upload.preflight.title":"Upload access is not granted yet","cli.upload.preflight.body":"Browsing, searching and downloading are open to your account already. Uploading needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once.","cli.upload_access.cta":"Ask for it with `nemar auth request-upload-access`.","cli.upload.preflight.unchecked":"Upload access could not be checked ({reason}); continuing.","cli.upload.preflight.gaps_unknown":"Could not determine what is still missing; run `nemar auth profile` for the list.","cli.upload.preflight.dry_run":"Continuing anyway: --dry-run uploads nothing."}});function Y$e(e){return e==="verified"||e==="upload_access"||e==="publication"}function ol(e){return(e??"").trim().length===0}function J$e(e){return e==="service"||e==="test"}function Zq(e,t={}){let r=t.orcidVerified===!0,n=Object.hasOwn(Bh,e)?Bh[e]:void 0;if(!n)return{field:e,label:e,blocks:t.blocks??[],setOnWeb:Ct["gap.set_on.default_web"],setOnCli:null,known:!1};let o=r&&n.orcidWebKey!==void 0;return{field:e,blocks:t.blocks??n.blocks,label:Ct[n.labelKey],setOnWeb:Ct[o?n.orcidWebKey:n.webKey],setOnCli:o||n.cliKey===null?null:Ct[n.cliKey],known:!0}}function Jq(e){let t=Fw.indexOf(e);return t===-1?Fw.length:t}function Qq(e,t={}){return e.map((r)=>Zq(r,{orcidVerified:t.orcidVerified}))}function Uh(e,t={}){return e.filter((r)=>!!r&&typeof r.field==="string").map((r)=>{let n=Array.isArray(r.blocks)?r.blocks.filter(Y$e):[];return Zq(r.field,{orcidVerified:t.orcidVerified,blocks:n.length>0?n:void 0})}).sort((r,n)=>Jq(r.field)-Jq(n.field))}function Pw(e){let t=e.blocks[0],r=t?Ct[K$e[t]]:Ct["gap.blocks.unknown"],n=gi(Ct["gap.sentence"],{label:"",blocks:r}).trimStart(),o=e.setOnCli?gi(Ct["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):gi(Ct["gap.set_on.web"],{web:e.setOnWeb});return`${n} ${o}`}function e9(e){return`${e.label} ${Pw(e)}`}function zh(){let e=gi(Ct["gap.sentence"],{label:Xq.label,blocks:Ct["cli.gap.blocks.sandbox"]}),t=gi(Ct["cli.gap.set_on.cli_only"],{cli:Xq.command});return`${e} ${t}`}function t9(){return Ct["cli.gaps.sandbox_unchecked"]}var Bh,Fw,act,K$e,Xq;var il=O(()=>{nl();Bh={email_verified:{blocks:["verified","upload_access"],labelKey:"gap.field.email_verified.label",webKey:"gap.field.email_verified.set_on.web",cliKey:"gap.field.email_verified.set_on.cli",isMissing:(e)=>e.status==="pending"||e.email_verified===!1},username:{blocks:["upload_access"],labelKey:"gap.field.username.label",webKey:"gap.field.username.set_on.web",cliKey:"gap.field.username.set_on.cli",isMissing:(e)=>e.username!==void 0&&ol(e.username)},given_name:{blocks:["upload_access","publication"],labelKey:"gap.field.given_name.label",webKey:"gap.field.given_name.set_on.web",cliKey:"gap.field.given_name.set_on.cli",orcidWebKey:"gap.field.given_name.set_on.web.orcid",isMissing:(e)=>ol(e.given_name)},family_name:{blocks:["upload_access","publication"],labelKey:"gap.field.family_name.label",webKey:"gap.field.family_name.set_on.web",cliKey:"gap.field.family_name.set_on.cli",orcidWebKey:"gap.field.family_name.set_on.web.orcid",isMissing:(e)=>ol(e.family_name)},orcid_verified:{blocks:["upload_access"],labelKey:"gap.field.orcid_verified.label",webKey:"gap.field.orcid_verified.set_on.web",cliKey:"gap.field.orcid_verified.set_on.cli",isMissing:(e)=>e.orcid_verified!==!0&&!J$e(e.account_kind)},github_username:{blocks:["upload_access","publication"],labelKey:"gap.field.github_username.label",webKey:"gap.field.github_username.set_on.web",cliKey:"gap.field.github_username.set_on.cli",isMissing:(e)=>ol(e.github_username)},city:{blocks:["upload_access"],labelKey:"gap.field.city.label",webKey:"gap.field.city.set_on.web",cliKey:"gap.field.city.set_on.cli",isMissing:(e)=>ol(e.city)},country:{blocks:["upload_access"],labelKey:"gap.field.country.label",webKey:"gap.field.country.set_on.web",cliKey:"gap.field.country.set_on.cli",isMissing:(e)=>ol(e.country)},why:{blocks:["upload_access"],labelKey:"gap.field.why.label",webKey:"gap.field.why.set_on.web",cliKey:"gap.field.why.set_on.cli",isMissing:null}},Fw=Object.keys(Bh),act=Fw.filter((e)=>Bh[e].isMissing!==null),K$e={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",publication:"gap.blocks.publication"};Xq={field:"sandbox",label:Ct["cli.gap.field.sandbox.label"],command:Ct["cli.gap.field.sandbox.set_on.cli"]}});function Wh(e,t){let r=e.sss!==void 0;if(e.derived!==r)t.addIssue({code:M.custom,path:["sss"],message:e.derived?"derived is true but sss is absent (ADR 0028: the two travel together)":"sss is present but derived is false (ADR 0028: the two travel together)"})}var xr,Vh,r9,Gh,X$e,Hh,Z$e,Q$e,eCe,tCe,rCe,uct,nCe,dct,oCe,fct;var Iw=O(()=>{en();xr=/^[a-z]{2}[0-9]{6}$/,Vh=/^[0-9a-f]{40}$/,r9=U({name:w(),modality:w().nullable().optional(),rate:k().nullable().optional(),n_channels:k().int().nonnegative().nullable().optional(),n_samples:k().int().nonnegative().nullable().optional(),duration_s:k().nonnegative().nullable().optional(),source_rate_hz:k().nullable().optional(),n_view_levels:k().int().nonnegative().optional(),view_chunk_columns:k().int().positive().optional(),chunk_samples:k().int().positive().optional(),shard_samples:k().int().positive().optional()}).passthrough(),Gh=U({converted:k().int().nonnegative().optional(),relabelled:k().int().nonnegative().optional(),kept_importer_unit:k().int().nonnegative().optional(),units_column_present:be().optional(),sidecar:w().optional(),sidecar_supplied:be().optional(),unmatched_channels:k().int().nonnegative().optional(),unmatched_case_only:k().int().positive().optional(),matched_case_only:k().int().positive().optional(),matched_case_only_examples:te(w()).max(5).optional(),unmatched_raw_label:k().int().positive().optional(),unmatched_examples:te(w()).max(5).optional()}).passthrough(),X$e=U({channels_tsv:k().int().positive(),in_file:k().int().nonnegative(),in_store:k().int().nonnegative()}).passthrough(),Hh=U({applied:be().optional(),method:w().optional(),calibration:w().optional(),cross_talk:w().optional(),mne_version:w().optional()}).passthrough();Z$e=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),updated_utc:w().optional(),source_tree:ze("raw"),derived:be(),modalities:te(w()).optional(),groups:te(r9).optional(),power_line_frequency:k().nullable().optional(),event_description_count:k().int().nonnegative().optional(),n_events:k().int().nonnegative().optional(),trial_types:ma(w(),k().int().nonnegative()).optional(),units_report:Gh.optional(),channels_tsv_read_error:be().optional(),channels_tsv_count_mismatch:X$e.optional(),split_members:te(w()).optional(),sss:Hh.optional()}).passthrough().superRefine(Wh),Q$e=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr").optional(),code:w(),reason:w(),detail:w().nullable().optional(),attempts:k().int().nonnegative().optional()}).passthrough(),eCe=Ze(["infra_failure","memory_budget","not_attempted"]),tCe=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),reason:eCe,attempts:k().int().nonnegative(),last_error:w().nullable().optional(),last_attempt_utc:w().nullable().optional()}).passthrough(),rCe=U({level0:ze("<zarr>/<group>/0"),view:ze("<zarr>/<group>/view/<L>"),view_levels:ze("1..n_view_levels from the group attrs"),scale_offset:ze("level-0 array attrs scale[] and offset[]; physical = digital * scale + offset"),events:ze("<data_base>events.parquet").optional()}).passthrough(),uct=U({format:ze("nemar-zarr-index"),format_version:ze(3),dataset_id:w().regex(xr,"NEMAR dataset id (nm/on/xx band)"),contract_base:w().regex(/^https:\/\//,"must be https"),data_base:w().regex(/^https:\/\//,"must be https"),data_base_kind:ze("s3-public"),s3_uri:w().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:w().min(1),s3_anonymous:be(),source_commit:w().regex(Vh,"must be a full 40-hex SHA"),engine_version:w().min(1),biosigio_version:w().nullable().optional(),updated_utc:w(),discovered_count:k().int().nonnegative(),store_count:k().int().nonnegative(),n_recordings:k().int().nonnegative(),errors:k().int().nonnegative(),failure_count:k().int().nonnegative(),pending_count:k().int().nonnegative(),stores:te(Z$e),failures:te(Q$e),pending:te(tCe),doi:w().nullable().optional(),license:w().nullable().optional(),citation:w().nullable().optional(),hed_version:w().nullable().optional(),events_parquet:w().regex(/^https:\/\//,"must be https").optional(),events_row_count:k().int().nonnegative().optional(),layout:rCe}).passthrough(),nCe=U({name:w(),configuration:ma(w(),Sd()).optional()}).passthrough(),dct=U({zarr_format:ze(3),node_type:ze("array"),shape:te(k().int().nonnegative()),data_type:w(),chunk_grid:U({name:w(),configuration:ma(w(),Sd()).optional()}).passthrough(),codecs:te(nCe),fill_value:Sd().optional(),attributes:ma(w(),Sd()).optional(),dimension_names:te(w().nullable()).optional()}).passthrough(),oCe=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),groups:te(r9).optional(),modalities:te(w()).optional()}).passthrough(),fct=U({format:ze("nemar-zarr-index"),format_version:k().int(),dataset_id:w().regex(xr,"NEMAR dataset id (nm/on/xx band)"),source_commit:w(),stores:te(oCe)}).passthrough()});function n9(e){let t=e.unit?` (${e.unit})`:"";switch(e.valueKind){case"enum":return`${e.label} -- comma-separated, one or more of: ${(e.enumValues??[]).join(", ")}`;case"number":return`${e.label}${t} -- range (e.g. 10..50, 10.., ..50, or 10)`;case"bytes":return`${e.label}${t} -- range with optional units (e.g. 10gb..2tb, 500mb.., ..1gb; bare = bytes)`;case"duration":return`${e.label}${t} -- range with optional units (e.g. 30m..2h, 100h.., ..90s; bare = seconds)`;case"text":return`${e.label} -- substring match`;case"version":return`${e.label} -- exact or prefix match`}}var iCe,sCe,aCe,cCe,ko,hct;var Kh=O(()=>{Cw();iCe=["10-05","10-10","10-20","biosemi","egi-geodesic","other"],sCe=["50","60"],aCe=["ready","pending","failed"],cCe=$w.options,ko=[{key:"subjects",flag:"--subjects",queryParam:"subjects",valueKind:"number",label:"Subject count",unit:"subjects"},{key:"channels",flag:"--channels",queryParam:"channels",valueKind:"number",label:"Channel count",unit:"channels"},{key:"sessions",flag:"--sessions",queryParam:"sessions",valueKind:"number",label:"Session count",unit:"sessions"},{key:"size",flag:"--size",queryParam:"size",valueKind:"bytes",label:"Dataset size"},{key:"files",flag:"--files",queryParam:"files",valueKind:"number",label:"File count",unit:"files"},{key:"citations",flag:"--citations",queryParam:"citations",valueKind:"number",label:"Citation count",unit:"citations"},{key:"duration",flag:"--duration",queryParam:"duration",valueKind:"duration",label:"Total recording duration"},{key:"recording-length",flag:"--recording-length",queryParam:"recording_length",valueKind:"duration",label:"Per-recording duration"},{key:"recordings",flag:"--recordings",queryParam:"recordings",valueKind:"number",label:"Recording count",unit:"recordings"},{key:"unavailable",flag:"--unavailable",queryParam:"unavailable",valueKind:"number",label:"Unavailable recording count",unit:"recordings"},{key:"age",flag:"--age",queryParam:"age",valueKind:"number",label:"Participant age",unit:"years"},{key:"rate",flag:"--rate",queryParam:"rate",valueKind:"number",label:"Sampling rate",unit:"Hz"},{key:"powerline",flag:"--powerline",queryParam:"powerline",valueKind:"enum",label:"Power line frequency",enumValues:sCe},{key:"reference",flag:"--reference",queryParam:"reference",valueKind:"text",label:"EEG reference"},{key:"placement",flag:"--placement",queryParam:"placement",valueKind:"text",label:"Electrode placement scheme"},{key:"electrode-system",flag:"--electrode-system",queryParam:"electrode_system",valueKind:"enum",label:"Electrode system",enumValues:iCe},{key:"source",flag:"--source",queryParam:"source",valueKind:"enum",label:"Source archive",enumValues:cCe},{key:"zarr",flag:"--zarr",queryParam:"zarr",valueKind:"enum",label:"Zarr conversion status",enumValues:aCe},{key:"bids-version",flag:"--bids-version",queryParam:"bids_version",valueKind:"version",label:"BIDS version"},{key:"hed-version",flag:"--hed-version",queryParam:"hed_version",valueKind:"version",label:"HED version"}],hct=new Map(ko.map((e)=>[e.key,e]))});var lCe,_ct,uCe,c9,Rd,o9,dCe,l9,fCe=20,pCe=100,mCe,u9,hCe,vct,wct,gCe,Dct,Ect,yCe,bCe,xCe,Sct,_Ce=50,vCe=500,$ct,wCe,DCe,Cct,ECe=1000,SCe=5000,i9=8,$Ce=100,CCe=32,s9,kct,kCe,RCe,ACe,Rct,OCe=800,FCe=4000,Act,Oct,Tw=60,Nw=64,a9,PCe=86400,ICe=4096,Fct,TCe,NCe,Pct;var d9=O(()=>{en();Kh();Iw();lCe=U({dataset_id:w().regex(xr),name:w(),doi:w().nullable().optional(),license:w().nullable().optional(),modalities:te(w()).optional(),tasks:te(w()).optional(),subject_count:k().int().nonnegative().nullable().optional(),has_hed:el([ze(0),ze(1)]).nullable().optional(),hed_version:w().nullable().optional(),store_count:k().int().nonnegative().nullable().optional(),recording_count:k().int().nonnegative().nullable().optional(),recordings_unavailable:k().int().nonnegative().nullable().optional(),total_recording_duration:k().nullable().optional(),zarr_converted_at:w().nullable().optional(),zarr_source_commit:w().nullable().optional(),zarr_errors:k().int().nonnegative().nullable().optional(),zarr_verify_status:Ze(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:w().nullable().optional(),index_url:w().nullable().optional()}).passthrough(),_ct=U({format:ze("nemar-zarr-catalog"),format_version:k().int(),generated_utc:w(),contract_base:w(),count:k().int().nonnegative(),datasets:te(lCe)}).passthrough(),uCe=["verified","failed","unverifiable"],c9=Ze(uCe).nullable(),Rd=U({dataset_id:w().regex(xr),doi:w().nullable(),license:w().nullable(),citation:w().nullable(),source_commit:w().regex(Vh),index_etag:w().nullable(),engine_version:w(),source_tree:ze("raw"),derived:be(),sss:Hh.optional(),lossy:be(),dtype:w().nullable(),effective_rate_hz:k().nullable(),source_rate_hz:k().nullable(),units_report:Gh.nullable().optional(),zarr_verify_status:c9,note:w().nullable().optional()}).passthrough().superRefine(Wh),o9=U({start:k().int().nonnegative(),end:k().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),dCe=U({python_zarr:w(),zarrita:w(),python_browser:w()}).passthrough(),l9=U({contract_base:w(),data_base:w(),s3_uri:w(),s3_region:w(),s3_anonymous:be(),zarr:w(),group:w(),level:el([ze("0"),k().int().positive()]),array_path:w(),dtype:w().nullable(),codecs:te(Sd()).optional(),chunk_samples:k().int().positive().nullable(),shard_samples:k().int().positive().nullable(),n_channels:k().int().nonnegative().nullable(),sample_slice:o9.optional(),channel_slice:o9.optional(),scale_offset:w(),how_to:dCe}).passthrough(),mCe=Object.fromEntries(ko.map((e)=>[e.queryParam,w().optional()])),u9={modality:w().optional(),task:w().optional(),has_hed:be().optional(),has_zarr:be().optional(),author:w().optional(),has_doi:be().optional(),has_zarr_verified:be().optional(),data_complete:be().optional(),recent:k().int().positive().optional(),license:w().optional()},hCe=Object.keys(u9),vct=[...hCe,...ko.map((e)=>e.queryParam)],wct=U({query:w().optional(),...u9,include_unknown:be().optional(),...mCe,limit:k().int().positive().max(pCe).default(fCe)}).passthrough(),gCe=U({dataset_id:w().regex(xr),name:w(),doi:w().nullable().optional(),license:w().nullable().optional(),modalities:te(w()).optional(),tasks:te(w()).optional(),subject_count:k().int().nullable().optional(),has_hed:be().nullable().optional(),has_zarr:be()}).passthrough(),Dct=U({results:te(gCe),count:k().int().nonnegative(),limit:k().int(),note:w().nullable().optional(),truncated:be().optional()}).passthrough(),Ect=U({dataset_id:w().regex(xr)}).passthrough(),yCe=["list_recordings","get_events","render_overview","read_window"],bCe=U({next_cheapest_tool:Ze(yCe),reason:w()}).passthrough(),xCe=["pending","ready","failed"],Sct=U({dataset_id:w().regex(xr),name:w(),doi:w().nullable(),license:w().nullable(),citation:w().nullable(),modalities:te(w()).optional(),tasks:te(w()).optional(),subject_count:k().int().nullable().optional(),has_hed:be().nullable().optional(),hed_version:w().nullable().optional(),recording_count:k().int().nullable().optional(),total_recording_duration_s:k().nullable().optional(),zarr_status:Ze(xCe).nullable().optional(),zarr_verify_status:c9.optional(),zarr_source_commit:w().nullable().optional(),zarr_store_count:k().int().nullable().optional(),cost_hint:bCe}).passthrough(),$ct=U({dataset_id:w().regex(xr),modality:w().optional(),min_duration_s:k().nonnegative().optional(),include_derived:be().default(!1),limit:k().int().positive().max(vCe).default(_Ce),offset:k().int().nonnegative().default(0)}).passthrough(),wCe=U({name:w(),modality:w().nullable().optional(),rate:k().nullable().optional(),n_channels:k().int().nullable().optional(),duration_s:k().nullable().optional(),n_view_levels:k().int().nonnegative().nullable().optional(),n_samples:k().int().nonnegative().nullable().optional(),view_chunk_columns:k().int().positive().nullable().optional()}).passthrough(),DCe=U({path:w(),zarr:w(),source_tree:ze("raw"),derived:be(),groups:te(wCe).optional(),n_events:k().int().nonnegative().optional(),sss:Hh.optional(),units_report:Gh.optional()}).passthrough().superRefine(Wh),Cct=U({dataset_id:w().regex(xr),source_commit:w().regex(Vh).nullable(),recordings:te(DCe),total_count:k().int().nonnegative(),excluded_derived_count:k().int().nonnegative(),limit:k().int(),offset:k().int(),index_format_version:k().int(),discovered_count:k().int().nonnegative().nullable(),failure_count:k().int().nonnegative().nullable(),pending_count:k().int().nonnegative().nullable(),excluded_legacy_non_raw_count:k().int().nonnegative(),note:w().nullable().optional(),envelope:Rd.optional()}).passthrough(),s9=w().min(1).max(64),kct=U({dataset_id:w().regex(xr),recording:w(),group:w().optional(),limit:k().int().positive().max(SCe).default(ECe),offset:k().int().nonnegative().default(0),where:ma(s9,te(el([w(),k()])).min(1).max($Ce)).refine((e)=>{let t=Object.keys(e).length;return t>=1&&t<=i9},{message:`where names 1 to ${i9} columns`}).optional(),columns:te(s9).min(1).max(CCe).optional()}).passthrough(),kCe=U({store_path:w(),group_name:w(),onset_s:k(),duration_s:k().nullable().optional(),sample_index:k().int().nonnegative(),trial_type:w().nullable().optional(),value:el([w(),k()]).nullable().optional(),hed:w().nullable().optional()}).passthrough(),RCe=kCe.partial().required({onset_s:!0,sample_index:!0}),ACe=U({name:w(),distinct_count:k().int().nonnegative(),null_count:k().int().nonnegative(),values:te(U({value:w(),count:k().int().positive()}).passthrough()).nullable()}).passthrough(),Rct=U({dataset_id:w().regex(xr),recording:w(),events:te(RCe),source:Ze(["events_parquet","events_tsv_fallback"]),estimated:be(),total_count:k().int().nonnegative(),limit:k().int(),offset:k().int(),truncated:be(),note:w().nullable().optional(),columns_summary:te(ACe).optional(),envelope:Rd.optional()}).passthrough(),Act=U({dataset_id:w().regex(xr),recording:w(),group:w().optional(),width_px:k().int().positive().max(FCe).default(OCe)}).passthrough(),Oct=U({dataset_id:w().regex(xr),recording:w(),group:w(),level:k().int().positive(),width_px:k().int().positive(),height_px:k().int().positive(),mime_type:ze("image/png"),columns_read:k().int().nonnegative(),chunks_read:k().int().nonnegative(),bytes_read:k().int().nonnegative(),envelope:Rd.optional()}).passthrough(),a9=Tw*Nw,Fct=U({dataset_id:w().regex(xr),recording:w(),group:w().optional(),start_s:k().nonnegative().default(0),duration_s:k().positive().max(PCe).default(10),channels:te(k().int().nonnegative()).max(ICe).optional(),taste:be().default(!1)}).passthrough().superRefine((e,t)=>{if(!e.taste)return;if(!e.channels||e.channels.length===0){t.addIssue({code:M.custom,message:"taste requires channels: name the channel indices you want (list_recordings reports each group's n_channels), or omit taste for a recipe",path:["channels"]});return}if(e.duration_s>Tw)t.addIssue({code:M.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${Tw} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>Nw)t.addIssue({code:M.custom,message:`taste channels (${e.channels.length}) exceeds the ${Nw}-channel cap; omit taste for a recipe instead`,path:["channels"]});let r=e.duration_s*e.channels.length;if(r>a9)t.addIssue({code:M.custom,message:`taste exceeds the cap of ${a9} channel-seconds (duration_s x channels = ${r}); omit taste for a recipe instead`,path:["duration_s"]})}),TCe=U({mode:ze("recipe"),recipe:l9,envelope:Rd}).passthrough(),NCe=U({mode:ze("taste"),start_s:k(),duration_s:k(),channels:te(k().int()),sample_rate_hz:k(),values:te(te(k())),recipe:l9,chunks_read:k().int().nonnegative(),bytes_read:k().int().nonnegative(),filled_ranges:te(U({start_sample:k().int().nonnegative(),end_sample:k().int().nonnegative(),start_s:k(),end_s:k()}).passthrough()),note:w().nullable().optional(),envelope:Rd}).passthrough(),Pct=_w("mode",[TCe,NCe])});var sl=O(()=>{ww();Cd();Cw();Lq();kw();Lh();nl();il();Iw();d9()});function Yh(e){return e?qCe:xs}var xs,jCe,qCe,jw;var Jh=O(()=>{xs=["ci_check","enrichment_check","s3_public_read","repo_public","tag_protect","doi_create","update_metadata","update_readme","create_tag","create_release","upload_to_zenodo","publish_doi","version_doi","s3_lock","sync_nemar","notify_user"],jCe=["update_metadata","update_readme","upload_to_zenodo","publish_doi"],qCe=xs.filter((e)=>!jCe.includes(e));jw={ci_check:"Check CI",enrichment_check:"Enrichment check",s3_public_read:"S3 public read",repo_public:"Make catalog row public",tag_protect:"Tag protection",doi_create:"Create DOI",update_metadata:"Update metadata",update_readme:"Update README",create_tag:"Create version tag",create_release:"Create GitHub release",upload_to_zenodo:"Upload to Zenodo (no-op)",publish_doi:"Publish DOI (irreversible)",version_doi:"Version DOI + manifest",s3_lock:"S3 Object Lock",sync_nemar:"Sync NEMAR (no-op)",notify_user:"Notify user"}});function Xh(e){let t=[],r="",n="start",o=!1;for(let i of e)switch(i){case"\\":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(o)r+=i;n="property",o=!o;break}case".":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(o){o=!1,r+=i;break}if(qw.has(r))return[];t.push(r),r="",n="property";break}case"[":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(o){o=!1,r+=i;break}if(n==="property"){if(qw.has(r))return[];t.push(r),r=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw Error("Invalid character after an index")}default:{if(n==="index"&&!MCe.has(i))throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(n==="start")n="property";if(o)o=!1,r+="\\";r+=i}}if(o)r+="\\";switch(n){case"property":{if(qw.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function Mw(e,t){if(typeof t!=="number"&&Array.isArray(e)){let r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return!1}function f9(e,t){if(Mw(e,t))throw Error("Cannot use string index")}function p9(e,t,r){if(!ha(e)||typeof t!=="string")return r===void 0?e:r;let n=Xh(t);if(n.length===0)return r;for(let o=0;o<n.length;o++){let i=n[o];if(Mw(e,i))e=o===n.length-1?void 0:null;else e=e[i];if(e===void 0||e===null){if(o!==n.length-1)return r;break}}return e===void 0?r:e}function Lw(e,t,r){if(!ha(e)||typeof t!=="string")return e;let n=e,o=Xh(t);for(let i=0;i<o.length;i++){let s=o[i];if(f9(e,s),i===o.length-1)e[s]=r;else if(!ha(e[s]))e[s]=typeof o[i+1]==="number"?[]:{};e=e[s]}return n}function m9(e,t){if(!ha(e)||typeof t!=="string")return!1;let r=Xh(t);for(let n=0;n<r.length;n++){let o=r[n];if(f9(e,o),n===r.length-1)return delete e[o],!0;if(e=e[o],!ha(e))return!1}}function h9(e,t){if(!ha(e)||typeof t!=="string")return!1;let r=Xh(t);if(r.length===0)return!1;for(let n of r){if(!ha(e)||!(n in e)||Mw(e,n))return!1;e=e[n]}return!0}var ha=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},qw,MCe;var g9=O(()=>{qw=new Set(["__proto__","prototype","constructor"]),MCe=new Set("0123456789")});import _t from"path";import y9 from"os";import Bw from"process";function zw(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(Bw.platform==="darwin")return LCe(e);if(Bw.platform==="win32")return BCe(e);return UCe(e)}var _s,Uw,al,LCe=(e)=>{let t=_t.join(_s,"Library");return{data:_t.join(t,"Application Support",e),config:_t.join(t,"Preferences",e),cache:_t.join(t,"Caches",e),log:_t.join(t,"Logs",e),temp:_t.join(Uw,e)}},BCe=(e)=>{let t=al.APPDATA||_t.join(_s,"AppData","Roaming"),r=al.LOCALAPPDATA||_t.join(_s,"AppData","Local");return{data:_t.join(r,e,"Data"),config:_t.join(t,e,"Config"),cache:_t.join(r,e,"Cache"),log:_t.join(r,e,"Log"),temp:_t.join(Uw,e)}},UCe=(e)=>{let t=_t.basename(_s);return{data:_t.join(al.XDG_DATA_HOME||_t.join(_s,".local","share"),e),config:_t.join(al.XDG_CONFIG_HOME||_t.join(_s,".config"),e),cache:_t.join(al.XDG_CACHE_HOME||_t.join(_s,".cache"),e),log:_t.join(al.XDG_STATE_HOME||_t.join(_s,".local","state"),e),temp:_t.join(Uw,t,e)}};var b9=O(()=>{_s=y9.homedir(),Uw=y9.tmpdir(),{env:al}=Bw});var zCe=(e,t)=>{let{onError:r}=t;return function(...o){return e.apply(void 0,o).catch(r)}},Ro;var x9=O(()=>{Ro=zCe});var VCe=(e,t)=>{let{onError:r}=t;return function(...o){try{return e.apply(void 0,o)}catch(i){return r(i)}}},Bn;var _9=O(()=>{Bn=VCe});var v9=250;var w9=()=>{};var GCe=(e,t)=>{let{isRetriable:r}=t;return function(o){let{timeout:i}=o,s=o.interval??v9,a=Date.now()+i;return function c(...u){return e.apply(void 0,u).catch((d)=>{if(!r(d))throw d;if(Date.now()>=a)throw d;let f=Math.round(s*Math.random());if(f>0)return new Promise((p)=>setTimeout(p,f)).then(()=>c.apply(void 0,u));else return c.apply(void 0,u)})}}},Ao;var D9=O(()=>{w9();Ao=GCe});var HCe=(e,t)=>{let{isRetriable:r}=t;return function(o){let{timeout:i}=o,s=Date.now()+i;return function(...c){while(!0)try{return e.apply(void 0,c)}catch(u){if(!r(u))throw u;if(Date.now()>=s)throw u;continue}}}},Oo;var E9=O(()=>{Oo=HCe});var Vw=O(()=>{x9();_9();D9();E9()});var Ad,Gw;var S9=O(()=>{Hw();Ad={isChangeErrorOk:(e)=>{if(!Ad.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!$9&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Ad.isNodeError(e))return!1;let{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM")return!0;return!1},onChangeError:(e)=>{if(!Ad.isNodeError(e))throw e;if(Ad.isChangeErrorOk(e))return;throw e}},Gw=Ad});import C9 from"process";var Od,Tr,$9,Zt;var Hw=O(()=>{S9();Od={onError:Gw.onChangeError},Tr={onError:()=>{return}},$9=C9.getuid?!C9.getuid():!1,Zt={isRetriable:Gw.isRetriableError}});import Ke from"fs";import{promisify as sr}from"util";var WCe,Gt;var Ww=O(()=>{Vw();Vw();Hw();WCe={attempt:{chmod:Ro(sr(Ke.chmod),Od),chown:Ro(sr(Ke.chown),Od),close:Ro(sr(Ke.close),Tr),fsync:Ro(sr(Ke.fsync),Tr),mkdir:Ro(sr(Ke.mkdir),Tr),realpath:Ro(sr(Ke.realpath),Tr),stat:Ro(sr(Ke.stat),Tr),unlink:Ro(sr(Ke.unlink),Tr),chmodSync:Bn(Ke.chmodSync,Od),chownSync:Bn(Ke.chownSync,Od),closeSync:Bn(Ke.closeSync,Tr),existsSync:Bn(Ke.existsSync,Tr),fsyncSync:Bn(Ke.fsync,Tr),mkdirSync:Bn(Ke.mkdirSync,Tr),realpathSync:Bn(Ke.realpathSync,Tr),statSync:Bn(Ke.statSync,Tr),unlinkSync:Bn(Ke.unlinkSync,Tr)},retry:{close:Ao(sr(Ke.close),Zt),fsync:Ao(sr(Ke.fsync),Zt),open:Ao(sr(Ke.open),Zt),readFile:Ao(sr(Ke.readFile),Zt),rename:Ao(sr(Ke.rename),Zt),stat:Ao(sr(Ke.stat),Zt),write:Ao(sr(Ke.write),Zt),writeFile:Ao(sr(Ke.writeFile),Zt),closeSync:Oo(Ke.closeSync,Zt),fsyncSync:Oo(Ke.fsyncSync,Zt),openSync:Oo(Ke.openSync,Zt),readFileSync:Oo(Ke.readFileSync,Zt),renameSync:Oo(Ke.renameSync,Zt),statSync:Oo(Ke.statSync,Zt),writeSync:Oo(Ke.writeSync,Zt),writeFileSync:Oo(Ke.writeFileSync,Zt)}},Gt=WCe});import ga from"process";var k9="utf8",Kw=438,R9=511,A9,O9,F9,P9=1000,I9,vlt,Yw=128;var Jw=O(()=>{A9={},O9=ga.geteuid?ga.geteuid():-1,F9=ga.getegid?ga.getegid():-1,I9=!!ga.getuid,vlt=ga.getuid?!ga.getuid():!1});var T9=(e)=>e instanceof Error&&("code"in e),Xw=(e)=>typeof e==="string",Zh=(e)=>e===void 0;var N9=()=>{};var j9=()=>{};import q9 from"process";var M9,Qh;var Zw=O(()=>{M9=q9.platform==="linux",Qh=q9.platform==="win32"});var Qw,L9;var B9=O(()=>{Zw();Qw=["SIGHUP","SIGINT","SIGTERM"];if(!Qh)Qw.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(M9)Qw.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");L9=Qw});import cl from"process";class U9{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(e)=>{if(this.exited)return;this.exited=!0;for(let t of this.callbacks)t();if(e)if(Qh&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))cl.kill(cl.pid,"SIGTERM");else cl.kill(cl.pid,e)},this.hook=()=>{cl.once("exit",()=>this.exit());for(let e of L9)try{cl.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var z9;var V9=O(()=>{Zw();B9();z9=new U9});var KCe,G9;var H9=O(()=>{V9();KCe=z9.register,G9=KCe});import YCe from"path";var tn,Fd;var W9=O(()=>{Ww();H9();Jw();tn={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),r=Date.now().toString().slice(-10),n="tmp-",o=`.tmp-${r}${t}`;return`${e}${o}`},get:(e,t,r=!0)=>{let n=tn.truncate(t(e));if(n in tn.store)return tn.get(e,t,r);return tn.store[n]=r,[n,()=>delete tn.store[n]]},purge:(e)=>{if(!tn.store[e])return;delete tn.store[e],Gt.attempt.unlink(e)},purgeSync:(e)=>{if(!tn.store[e])return;delete tn.store[e],Gt.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in tn.store)tn.purgeSync(e)},truncate:(e)=>{let t=YCe.basename(e);if(t.length<=Yw)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-Yw;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};G9(tn.purgeSyncAll);Fd=tn});import JCe from"path";function e1(e,t,r=A9){if(Xw(r))return e1(e,t,{encoding:r});let o={timeout:r.timeout??P9},i=null,s=null,a=null;try{let c=Gt.attempt.realpathSync(e),u=!!c;e=c||e,[s,i]=Fd.get(e,r.tmpCreate||Fd.create,r.tmpPurge!==!1);let d=I9&&Zh(r.chown),f=Zh(r.mode);if(u&&(d||f)){let m=Gt.attempt.statSync(e);if(m){if(r={...r},d)r.chown={uid:m.uid,gid:m.gid};if(f)r.mode=m.mode}}if(!u){let m=JCe.dirname(e);Gt.attempt.mkdirSync(m,{mode:R9,recursive:!0})}if(a=Gt.retry.openSync(o)(s,"w",r.mode||Kw),r.tmpCreated)r.tmpCreated(s);if(Xw(t))Gt.retry.writeSync(o)(a,t,0,r.encoding||k9);else if(!Zh(t))Gt.retry.writeSync(o)(a,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)Gt.retry.fsyncSync(o)(a);else Gt.attempt.fsync(a);if(Gt.retry.closeSync(o)(a),a=null,r.chown&&(r.chown.uid!==O9||r.chown.gid!==F9))Gt.attempt.chownSync(s,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==Kw)Gt.attempt.chmodSync(s,r.mode);try{Gt.retry.renameSync(o)(s,e)}catch(m){if(!T9(m))throw m;if(m.code!=="ENAMETOOLONG")throw m;Gt.retry.renameSync(o)(s,Fd.truncate(e))}i(),s=null}finally{if(a)Gt.attempt.closeSync(a);if(s)Fd.purge(s)}}var K9=O(()=>{Ww();Jw();N9();j9();W9()});var Id=y(function(X9){Object.defineProperty(X9,"__esModule",{value:!0});X9.regexpCode=X9.getEsmExportName=X9.getProperty=X9.safeStringify=X9.stringify=X9.strConcat=X9.addCodeArg=X9.str=X9._=X9.nil=X9._Code=X9.Name=X9.IDENTIFIER=X9._CodeOrName=void 0;class eg{}X9._CodeOrName=eg;X9.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class ll extends eg{constructor(e){super();if(!X9.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}X9.Name=ll;class Un extends eg{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof ll)t[r.str]=(t[r.str]||0)+1;return t},{})}}X9._Code=Un;X9.nil=new Un("");function Y9(e,...t){let r=[e[0]],n=0;while(n<t.length)r1(r,t[n]),r.push(e[++n]);return new Un(r)}X9._=Y9;var t1=new Un("+");function J9(e,...t){let r=[Pd(e[0])],n=0;while(n<t.length)r.push(t1),r1(r,t[n]),r.push(t1,Pd(e[++n]));return XCe(r),new Un(r)}X9.str=J9;function r1(e,t){if(t instanceof Un)e.push(...t._items);else if(t instanceof ll)e.push(t);else e.push(eke(t))}X9.addCodeArg=r1;function XCe(e){let t=1;while(t<e.length-1){if(e[t]===t1){let r=ZCe(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function ZCe(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof ll||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof ll))return`"${e}${t.slice(1)}`;return}function QCe(e,t){return t.emptyStr()?e:e.emptyStr()?t:J9`${e}${t}`}X9.strConcat=QCe;function eke(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Pd(Array.isArray(e)?e.join(","):e)}function tke(e){return new Un(Pd(e))}X9.stringify=tke;function Pd(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}X9.safeStringify=Pd;function rke(e){return typeof e=="string"&&X9.IDENTIFIER.test(e)?new Un(`.${e}`):Y9`[${e}]`}X9.getProperty=rke;function nke(e){if(typeof e=="string"&&X9.IDENTIFIER.test(e))return new Un(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}X9.getEsmExportName=nke;function oke(e){return new Un(e.toString())}X9.regexpCode=oke});var s1=y(function(tM){Object.defineProperty(tM,"__esModule",{value:!0});tM.ValueScope=tM.ValueScopeName=tM.Scope=tM.varKinds=tM.UsedValueState=void 0;var Nr=Id();class Q9 extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var rg;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(rg||(tM.UsedValueState=rg={}));tM.varKinds={const:new Nr.Name("const"),let:new Nr.Name("let"),var:new Nr.Name("var")};class o1{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof Nr.Name?e:this.name(e)}name(e){return new Nr.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}tM.Scope=o1;class i1 extends Nr.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=Nr._`.${new Nr.Name(t)}[${r}]`}}tM.ValueScopeName=i1;var yke=Nr._`\n`;class eM extends o1{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?yke:Nr.nil}}get(){return this._scope}name(e){return new i1(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:o}=n,i=(r=t.key)!==null&&r!==void 0?r:t.ref,s=this._values[o];if(s){let u=s.get(i);if(u)return u}else s=this._values[o]=new Map;s.set(i,n);let a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:o,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return Nr._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let o=Nr.nil;for(let i in e){let s=e[i];if(!s)continue;let a=r[i]=r[i]||new Map;s.forEach((c)=>{if(a.has(c))return;a.set(c,rg.Started);let u=t(c);if(u){let d=this.opts.es5?tM.varKinds.var:tM.varKinds.const;o=Nr._`${o}${d} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))o=Nr._`${o}${u}${this.opts._n}`;else throw new Q9(c);a.set(c,rg.Completed)})}return o}}tM.ValueScope=eM});var Ee=y(function(jr){Object.defineProperty(jr,"__esModule",{value:!0});jr.or=jr.and=jr.not=jr.CodeGen=jr.operators=jr.varKinds=jr.ValueScopeName=jr.ValueScope=jr.Scope=jr.Name=jr.regexpCode=jr.stringify=jr.getProperty=jr.nil=jr.strConcat=jr.str=jr._=void 0;var Le=Id(),zn=s1(),vs=Id();Object.defineProperty(jr,"_",{enumerable:!0,get:function(){return vs._}});Object.defineProperty(jr,"str",{enumerable:!0,get:function(){return vs.str}});Object.defineProperty(jr,"strConcat",{enumerable:!0,get:function(){return vs.strConcat}});Object.defineProperty(jr,"nil",{enumerable:!0,get:function(){return vs.nil}});Object.defineProperty(jr,"getProperty",{enumerable:!0,get:function(){return vs.getProperty}});Object.defineProperty(jr,"stringify",{enumerable:!0,get:function(){return vs.stringify}});Object.defineProperty(jr,"regexpCode",{enumerable:!0,get:function(){return vs.regexpCode}});Object.defineProperty(jr,"Name",{enumerable:!0,get:function(){return vs.Name}});var cg=s1();Object.defineProperty(jr,"Scope",{enumerable:!0,get:function(){return cg.Scope}});Object.defineProperty(jr,"ValueScope",{enumerable:!0,get:function(){return cg.ValueScope}});Object.defineProperty(jr,"ValueScopeName",{enumerable:!0,get:function(){return cg.ValueScopeName}});Object.defineProperty(jr,"varKinds",{enumerable:!0,get:function(){return cg.varKinds}});jr.operators={GT:new Le._Code(">"),GTE:new Le._Code(">="),LT:new Le._Code("<"),LTE:new Le._Code("<="),EQ:new Le._Code("==="),NEQ:new Le._Code("!=="),NOT:new Le._Code("!"),OR:new Le._Code("||"),AND:new Le._Code("&&"),ADD:new Le._Code("+")};class ws{optimizeNodes(){return this}optimizeNames(e,t){return this}}class nM extends ws{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?zn.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=dl(this.rhs,e,t);return this}get names(){return this.rhs instanceof Le._CodeOrName?this.rhs.names:{}}}class l1 extends ws{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof Le.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=dl(this.rhs,e,t),this}get names(){let e=this.lhs instanceof Le.Name?{}:{...this.lhs.names};return ag(e,this.rhs)}}class oM extends l1{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class iM extends ws{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class sM extends ws{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class aM extends ws{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class cM extends ws{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=dl(this.code,e,t),this}get names(){return this.code instanceof Le._CodeOrName?this.code.names:{}}}class lg extends ws{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let o=r[n];if(o.optimizeNames(e,t))continue;vke(e,o.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ya(e,t.names),{})}}class Ds extends lg{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class lM extends lg{}class Td extends Ds{}Td.kind="else";class yi extends Ds{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Td(r):r}if(t){if(e===!1)return t instanceof yi?t:t.nodes;if(this.nodes.length)return this;return new yi(mM(e),t instanceof yi?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=dl(this.condition,e,t),this}get names(){let e=super.names;if(ag(e,this.condition),this.else)ya(e,this.else.names);return e}}yi.kind="if";class ul extends Ds{}ul.kind="for";class uM extends ul{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=dl(this.iteration,e,t),this}get names(){return ya(super.names,this.iteration.names)}}class dM extends ul{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?zn.varKinds.var:this.varKind,{name:r,from:n,to:o}=this;return`for(${t} ${r}=${n}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){let e=ag(super.names,this.from);return ag(e,this.to)}}class a1 extends ul{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=dl(this.iterable,e,t),this}get names(){return ya(super.names,this.iterable.names)}}class ng extends Ds{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}ng.kind="func";class og extends lg{render(e){return"return "+super.render(e)}}og.kind="return";class fM extends Ds{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)ya(e,this.catch.names);if(this.finally)ya(e,this.finally.names);return e}}class ig extends Ds{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}ig.kind="catch";class sg extends Ds{render(e){return"finally"+super.render(e)}}sg.kind="finally";class pM{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
84
+ `;return this.stop(),this.#i.write(u),this}}function D(e){return new hq(e)}var ld,ZSe;var Mn=O(()=>{Xe();eq();rq();aw();uq();fq();mq();ld=ye(ym(),1),ZSe=ye(ym(),1)});var Ne,bq,W,ui=(e)=>{switch(typeof e){case"undefined":return W.undefined;case"string":return W.string;case"number":return Number.isNaN(e)?W.nan:W.number;case"boolean":return W.boolean;case"function":return W.function;case"bigint":return W.bigint;case"symbol":return W.symbol;case"object":if(Array.isArray(e))return W.array;if(e===null)return W.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return W.promise;if(typeof Map<"u"&&e instanceof Map)return W.map;if(typeof Set<"u"&&e instanceof Set)return W.set;if(typeof Date<"u"&&e instanceof Date)return W.date;return W.object;default:return W.unknown}};var ud=O(()=>{(function(e){e.assertEqual=(o)=>{};function t(o){}e.assertIs=t;function r(o){throw Error()}e.assertNever=r,e.arrayToEnum=(o)=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=(o)=>{let i=e.objectKeys(o).filter((a)=>typeof o[o[a]]!=="number"),s={};for(let a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=(o)=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys==="function"?(o)=>Object.keys(o):(o)=>{let i=[];for(let s in o)if(Object.prototype.hasOwnProperty.call(o,s))i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s;return},e.isInteger=typeof Number.isInteger==="function"?(o)=>Number.isInteger(o):(o)=>typeof o==="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map((s)=>typeof s==="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>{if(typeof i==="bigint")return i.toString();return i}})(Ne||(Ne={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(bq||(bq={}));W=Ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var M,Zr;var Eh=O(()=>{ud();M=Ne.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"]);Zr=class Zr extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(o){return o.message},r={_errors:[]},n=(o)=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let s=r,a=0;while(a<i.path.length){let c=i.path[a];if(a!==i.path.length-1)s[c]=s[c]||{_errors:[]};else s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(i));s=s[c],a++}}};return n(this),r}static assert(e){if(!(e instanceof Zr))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let o=n.path[0];t[o]=t[o]||[],t[o].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};Zr.create=(e)=>new Zr(e)});var QSe=(e,t)=>{let r;switch(e.code){case M.invalid_type:if(e.received===W.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case M.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ne.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ne.joinValues(e.keys,", ")}`;break;case M.invalid_union:r="Invalid input";break;case M.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ne.joinValues(e.options)}`;break;case M.invalid_enum_value:r=`Invalid enum value. Expected ${Ne.joinValues(e.options)}, received '${e.received}'`;break;case M.invalid_arguments:r="Invalid function arguments";break;case M.invalid_return_type:r="Invalid function return type";break;case M.invalid_date:r="Invalid date";break;case M.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)r=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)r=`Invalid input: must end with "${e.validation.endsWith}"`;else Ne.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case M.too_small:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else r="Invalid input";break;case M.too_big:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else r="Invalid input";break;case M.custom:r="Invalid input";break;case M.invalid_intersection_types:r="Intersection results could not be merged";break;case M.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case M.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ne.assertNever(e)}return{message:r}},ys;var fw=O(()=>{Eh();ud();ys=QSe});function dd(){return e$e}var e$e;var Sh=O(()=>{fw();e$e=ys});function G(e,t){let r=dd(),n=$h({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ys?void 0:ys].filter((o)=>!!o)});e.common.issues.push(n)}class ir{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let r=[];for(let n of t){if(n.status==="aborted")return de;if(n.status==="dirty")e.dirty();r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let n of t){let o=await n.key,i=await n.value;r.push({key:o,value:i})}return ir.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:o,value:i}=n;if(o.status==="aborted")return de;if(i.status==="aborted")return de;if(o.status==="dirty")e.dirty();if(i.status==="dirty")e.dirty();if(o.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet))r[o.value]=i.value}return{status:e.value,value:r}}}var $h=(e)=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",c=n.filter((u)=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},de,Kc=(e)=>({status:"dirty",value:e}),br=(e)=>({status:"valid",value:e}),pw=(e)=>e.status==="aborted",mw=(e)=>e.status==="dirty",da=(e)=>e.status==="valid",fd=(e)=>typeof Promise<"u"&&e instanceof Promise;var hw=O(()=>{Sh();fw();de=Object.freeze({status:"aborted"})});var xq=()=>{};var ne;var _q=O(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(ne||(ne={}))});class Ln{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function De(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:o};return{errorMap:(s,a)=>{let{message:c}=e;if(s.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??n??a.defaultError};if(s.code!=="invalid_type")return{message:a.defaultError};return{message:c??r??a.defaultError}},description:o}}class Fe{get description(){return this._def.description}_getType(e){return ui(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ui(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ir,ctx:{common:e.parent.common,data:e.data,parsedType:ui(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(fd(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ui(e)},n=this._parseSync({data:e,path:r.path,parent:r});return vq(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ui(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return da(r)?{value:r.value}:{issues:t.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((r)=>da(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ui(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(fd(n)?n:Promise.resolve(n));return vq(r,o)}refine(e,t){let r=(n)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(n);else return t};return this._refinement((n,o)=>{let i=e(n),s=()=>o.addIssue({code:M.custom,...r(n)});if(typeof Promise<"u"&&i instanceof Promise)return i.then((a)=>{if(!a)return s(),!1;else return!0});if(!i)return s(),!1;else return!0})}refinement(e,t){return this._refinement((r,n)=>{if(!e(r))return n.addIssue(typeof t==="function"?t(r,n):t),!1;else return!0})}_refinement(e){return new Co({schema:this,typeName:fe.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 $o.create(this,this._def)}nullable(){return bs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return So.create(this)}promise(){return Qc.create(this,this._def)}or(e){return yd.create([this,e],this._def)}and(e){return bd.create(this,e,this._def)}transform(e){return new Co({...De(this._def),schema:this,typeName:fe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new wd({...De(this._def),innerType:this,defaultValue:t,typeName:fe.ZodDefault})}brand(){return new xw({typeName:fe.ZodBranded,type:this,...De(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Dd({...De(this._def),innerType:this,catchValue:t,typeName:fe.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Ih.create(this,e)}readonly(){return Ed.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Dq(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function y$e(e){return new RegExp(`^${Dq(e)}$`)}function b$e(e){let t=`${wq}T${Dq(e)}`,r=[];if(r.push(e.local?"Z?":"Z"),e.offset)r.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function x$e(e,t){if((t==="v4"||!t)&&u$e.test(e))return!0;if((t==="v6"||!t)&&f$e.test(e))return!0;return!1}function _$e(e,t){if(!s$e.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));if(typeof o!=="object"||o===null)return!1;if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&o.alg!==t)return!1;return!0}catch{return!1}}function v$e(e,t){if((t==="v4"||!t)&&d$e.test(e))return!0;if((t==="v6"||!t)&&p$e.test(e))return!0;return!1}function w$e(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function Yc(e){if(e instanceof $t){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=$o.create(Yc(n))}return new $t({...e._def,shape:()=>t})}else if(e instanceof So)return new So({...e._def,type:Yc(e.element)});else if(e instanceof $o)return $o.create(Yc(e.unwrap()));else if(e instanceof bs)return bs.create(Yc(e.unwrap()));else if(e instanceof mi)return mi.create(e.items.map((t)=>Yc(t)));else return e}function yw(e,t){let r=ui(e),n=ui(t);if(e===t)return{valid:!0,data:e};else if(r===W.object&&n===W.object){let o=Ne.objectKeys(t),i=Ne.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=yw(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===W.array&&n===W.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],c=yw(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else if(r===W.date&&n===W.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function Eq(e,t){return new pa({values:e,typeName:fe.ZodEnum,...De(t)})}var vq=(e,t)=>{if(da(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Zr(e.common.issues);return this._error=r,this._error}}}},t$e,r$e,n$e,o$e,i$e,s$e,a$e,c$e,l$e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",gw,u$e,d$e,f$e,p$e,m$e,h$e,wq="((\\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])))",g$e,fi,Jc,Xc,Ch,md,kh,hd,gd,Rh,fa,pi,Ah,So,$t,yd,di=(e)=>{if(e instanceof xd)return di(e.schema);else if(e instanceof Co)return di(e.innerType());else if(e instanceof _d)return[e.value];else if(e instanceof pa)return e.options;else if(e instanceof vd)return Ne.objectValues(e.enum);else if(e instanceof wd)return di(e._def.innerType);else if(e instanceof hd)return[void 0];else if(e instanceof gd)return[null];else if(e instanceof $o)return[void 0,...di(e.unwrap())];else if(e instanceof bs)return[null,...di(e.unwrap())];else if(e instanceof xw)return di(e.unwrap());else if(e instanceof Ed)return di(e.unwrap());else if(e instanceof Dd)return di(e._def.innerType);else return[]},bw,bd,mi,Oh,Fh,Zc,pd,xd,_d,pa,vd,Qc,Co,$o,bs,wd,Dd,Ph,Jst,xw,Ih,Ed,Xst,fe,w,k,Zst,Qst,be,eat,tat,rat,nat,oat,Sd,iat,sat,te,U,aat,el,_w,cat,lat,ma,uat,dat,fat,pat,ze,Ze,mat,hat,gat,yat,bat,xat,_at;var Sq=O(()=>{Eh();Sh();_q();hw();ud();t$e=/^c[^\s-]{8,}$/i,r$e=/^[0-9a-z]+$/,n$e=/^[0-9A-HJKMNP-TV-Z]{26}$/i,o$e=/^[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,i$e=/^[a-z0-9_-]{21}$/i,s$e=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,a$e=/^[-+]?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)?)??$/,c$e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,u$e=/^(?:(?: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])$/,d$e=/^(?:(?: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])$/,f$e=/^(([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]))$/,p$e=/^(([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])$/,m$e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,h$e=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,g$e=new RegExp(`^${wq}$`);fi=class fi extends Fe{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==W.string){let o=this._getOrReturnCtx(e);return G(o,{code:M.invalid_type,expected:W.string,received:o.parsedType}),de}let r=new ir,n=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.length<o.value)n=this._getOrReturnCtx(e,n),G(n,{code:M.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="max"){if(e.data.length>o.value)n=this._getOrReturnCtx(e,n),G(n,{code:M.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="length"){let i=e.data.length>o.value,s=e.data.length<o.value;if(i||s){if(n=this._getOrReturnCtx(e,n),i)G(n,{code:M.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(s)G(n,{code:M.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});r.dirty()}}else if(o.kind==="email"){if(!c$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"email",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="emoji"){if(!gw)gw=new RegExp(l$e,"u");if(!gw.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"emoji",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="uuid"){if(!o$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"uuid",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="nanoid"){if(!i$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"nanoid",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cuid"){if(!t$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"cuid",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cuid2"){if(!r$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"cuid2",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="ulid"){if(!n$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"ulid",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),G(n,{validation:"url",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="regex"){if(o.regex.lastIndex=0,!o.regex.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"regex",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="trim")e.data=e.data.trim();else if(o.kind==="includes"){if(!e.data.includes(o.value,o.position))n=this._getOrReturnCtx(e,n),G(n,{code:M.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()}else if(o.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(o.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(o.kind==="startsWith"){if(!e.data.startsWith(o.value))n=this._getOrReturnCtx(e,n),G(n,{code:M.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()}else if(o.kind==="endsWith"){if(!e.data.endsWith(o.value))n=this._getOrReturnCtx(e,n),G(n,{code:M.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()}else if(o.kind==="datetime"){if(!b$e(o).test(e.data))n=this._getOrReturnCtx(e,n),G(n,{code:M.invalid_string,validation:"datetime",message:o.message}),r.dirty()}else if(o.kind==="date"){if(!g$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{code:M.invalid_string,validation:"date",message:o.message}),r.dirty()}else if(o.kind==="time"){if(!y$e(o).test(e.data))n=this._getOrReturnCtx(e,n),G(n,{code:M.invalid_string,validation:"time",message:o.message}),r.dirty()}else if(o.kind==="duration"){if(!a$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"duration",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="ip"){if(!x$e(e.data,o.version))n=this._getOrReturnCtx(e,n),G(n,{validation:"ip",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="jwt"){if(!_$e(e.data,o.alg))n=this._getOrReturnCtx(e,n),G(n,{validation:"jwt",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cidr"){if(!v$e(e.data,o.version))n=this._getOrReturnCtx(e,n),G(n,{validation:"cidr",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="base64"){if(!m$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"base64",code:M.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="base64url"){if(!h$e.test(e.data))n=this._getOrReturnCtx(e,n),G(n,{validation:"base64url",code:M.invalid_string,message:o.message}),r.dirty()}else Ne.assertNever(o);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((n)=>e.test(n),{validation:t,code:M.invalid_string,...ne.errToObj(r)})}_addCheck(e){return new fi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ne.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ne.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ne.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ne.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ne.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ne.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ne.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ne.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ne.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ne.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ne.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ne.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ne.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...ne.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ne.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ne.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...ne.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...ne.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ne.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ne.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ne.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ne.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ne.errToObj(t)})}nonempty(e){return this.min(1,ne.errToObj(e))}trim(){return new fi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new fi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new fi({...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)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};fi.create=(e)=>new fi({checks:[],typeName:fe.ZodString,coerce:e?.coerce??!1,...De(e)});Jc=class Jc extends Fe{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);if(this._getType(e)!==W.number){let o=this._getOrReturnCtx(e);return G(o,{code:M.invalid_type,expected:W.number,received:o.parsedType}),de}let r=void 0,n=new ir;for(let o of this._def.checks)if(o.kind==="int"){if(!Ne.isInteger(e.data))r=this._getOrReturnCtx(e,r),G(r,{code:M.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()}else if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)r=this._getOrReturnCtx(e,r),G(r,{code:M.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)r=this._getOrReturnCtx(e,r),G(r,{code:M.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="multipleOf"){if(w$e(e.data,o.value)!==0)r=this._getOrReturnCtx(e,r),G(r,{code:M.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()}else if(o.kind==="finite"){if(!Number.isFinite(e.data))r=this._getOrReturnCtx(e,r),G(r,{code:M.not_finite,message:o.message}),n.dirty()}else Ne.assertNever(o);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ne.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ne.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ne.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ne.toString(t))}setLimit(e,t,r,n){return new Jc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ne.toString(n)}]})}_addCheck(e){return new Jc({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ne.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ne.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ne.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ne.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ne.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ne.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ne.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ne.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ne.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&Ne.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(t===null||r.value>t)t=r.value}else if(r.kind==="max"){if(e===null||r.value<e)e=r.value}return Number.isFinite(t)&&Number.isFinite(e)}};Jc.create=(e)=>new Jc({checks:[],typeName:fe.ZodNumber,coerce:e?.coerce||!1,...De(e)});Xc=class Xc extends Fe{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)!==W.bigint)return this._getInvalidInput(e);let r=void 0,n=new ir;for(let o of this._def.checks)if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)r=this._getOrReturnCtx(e,r),G(r,{code:M.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)r=this._getOrReturnCtx(e,r),G(r,{code:M.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()}else if(o.kind==="multipleOf"){if(e.data%o.value!==BigInt(0))r=this._getOrReturnCtx(e,r),G(r,{code:M.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()}else Ne.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return G(t,{code:M.invalid_type,expected:W.bigint,received:t.parsedType}),de}gte(e,t){return this.setLimit("min",e,!0,ne.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ne.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ne.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ne.toString(t))}setLimit(e,t,r,n){return new Xc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ne.toString(n)}]})}_addCheck(e){return new Xc({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ne.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ne.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ne.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ne.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ne.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};Xc.create=(e)=>new Xc({checks:[],typeName:fe.ZodBigInt,coerce:e?.coerce??!1,...De(e)});Ch=class Ch extends Fe{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==W.boolean){let r=this._getOrReturnCtx(e);return G(r,{code:M.invalid_type,expected:W.boolean,received:r.parsedType}),de}return br(e.data)}};Ch.create=(e)=>new Ch({typeName:fe.ZodBoolean,coerce:e?.coerce||!1,...De(e)});md=class md extends Fe{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==W.date){let o=this._getOrReturnCtx(e);return G(o,{code:M.invalid_type,expected:W.date,received:o.parsedType}),de}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return G(o,{code:M.invalid_date}),de}let r=new ir,n=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.getTime()<o.value)n=this._getOrReturnCtx(e,n),G(n,{code:M.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()}else if(o.kind==="max"){if(e.data.getTime()>o.value)n=this._getOrReturnCtx(e,n),G(n,{code:M.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()}else Ne.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new md({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ne.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ne.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(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)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}};md.create=(e)=>new md({checks:[],coerce:e?.coerce||!1,typeName:fe.ZodDate,...De(e)});kh=class kh extends Fe{_parse(e){if(this._getType(e)!==W.symbol){let r=this._getOrReturnCtx(e);return G(r,{code:M.invalid_type,expected:W.symbol,received:r.parsedType}),de}return br(e.data)}};kh.create=(e)=>new kh({typeName:fe.ZodSymbol,...De(e)});hd=class hd extends Fe{_parse(e){if(this._getType(e)!==W.undefined){let r=this._getOrReturnCtx(e);return G(r,{code:M.invalid_type,expected:W.undefined,received:r.parsedType}),de}return br(e.data)}};hd.create=(e)=>new hd({typeName:fe.ZodUndefined,...De(e)});gd=class gd extends Fe{_parse(e){if(this._getType(e)!==W.null){let r=this._getOrReturnCtx(e);return G(r,{code:M.invalid_type,expected:W.null,received:r.parsedType}),de}return br(e.data)}};gd.create=(e)=>new gd({typeName:fe.ZodNull,...De(e)});Rh=class Rh extends Fe{constructor(){super(...arguments);this._any=!0}_parse(e){return br(e.data)}};Rh.create=(e)=>new Rh({typeName:fe.ZodAny,...De(e)});fa=class fa extends Fe{constructor(){super(...arguments);this._unknown=!0}_parse(e){return br(e.data)}};fa.create=(e)=>new fa({typeName:fe.ZodUnknown,...De(e)});pi=class pi extends Fe{_parse(e){let t=this._getOrReturnCtx(e);return G(t,{code:M.invalid_type,expected:W.never,received:t.parsedType}),de}};pi.create=(e)=>new pi({typeName:fe.ZodNever,...De(e)});Ah=class Ah extends Fe{_parse(e){if(this._getType(e)!==W.undefined){let r=this._getOrReturnCtx(e);return G(r,{code:M.invalid_type,expected:W.void,received:r.parsedType}),de}return br(e.data)}};Ah.create=(e)=>new Ah({typeName:fe.ZodVoid,...De(e)});So=class So extends Fe{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==W.array)return G(t,{code:M.invalid_type,expected:W.array,received:t.parsedType}),de;if(n.exactLength!==null){let i=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;if(i||s)G(t,{code:i?M.too_big:M.too_small,minimum:s?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty()}if(n.minLength!==null){if(t.data.length<n.minLength.value)G(t,{code:M.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()}if(n.maxLength!==null){if(t.data.length>n.maxLength.value)G(t,{code:M.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()}if(t.common.async)return Promise.all([...t.data].map((i,s)=>n.type._parseAsync(new Ln(t,i,t.path,s)))).then((i)=>ir.mergeArray(r,i));let o=[...t.data].map((i,s)=>n.type._parseSync(new Ln(t,i,t.path,s)));return ir.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new So({...this._def,minLength:{value:e,message:ne.toString(t)}})}max(e,t){return new So({...this._def,maxLength:{value:e,message:ne.toString(t)}})}length(e,t){return new So({...this._def,exactLength:{value:e,message:ne.toString(t)}})}nonempty(e){return this.min(1,e)}};So.create=(e,t)=>new So({type:e,minLength:null,maxLength:null,exactLength:null,typeName:fe.ZodArray,...De(t)});$t=class $t extends Fe{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=Ne.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==W.object){let c=this._getOrReturnCtx(e);return G(c,{code:M.invalid_type,expected:W.object,received:c.parsedType}),de}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof pi&&this._def.unknownKeys==="strip")){for(let c in n.data)if(!i.includes(c))s.push(c)}let a=[];for(let c of i){let u=o[c],d=n.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new Ln(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof pi){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of s)a.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict"){if(s.length>0)G(n,{code:M.unrecognized_keys,keys:s}),r.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of s){let d=n.data[u];a.push({key:{status:"valid",value:u},value:c._parse(new Ln(n,d,n.path,u)),alwaysSet:u in n.data})}}if(n.common.async)return Promise.resolve().then(async()=>{let c=[];for(let u of a){let d=await u.key,f=await u.value;c.push({key:d,value:f,alwaysSet:u.alwaysSet})}return c}).then((c)=>ir.mergeObjectSync(r,c));else return ir.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(e){return ne.errToObj,new $t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;if(t.code==="unrecognized_keys")return{message:ne.errToObj(e).message??n};return{message:n}}}:{}})}strip(){return new $t({...this._def,unknownKeys:"strip"})}passthrough(){return new $t({...this._def,unknownKeys:"passthrough"})}extend(e){return new $t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new $t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:fe.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new $t({...this._def,catchall:e})}pick(e){let t={};for(let r of Ne.objectKeys(e))if(e[r]&&this.shape[r])t[r]=this.shape[r];return new $t({...this._def,shape:()=>t})}omit(e){let t={};for(let r of Ne.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new $t({...this._def,shape:()=>t})}deepPartial(){return Yc(this)}partial(e){let t={};for(let r of Ne.objectKeys(this.shape)){let n=this.shape[r];if(e&&!e[r])t[r]=n;else t[r]=n.optional()}return new $t({...this._def,shape:()=>t})}required(e){let t={};for(let r of Ne.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let o=this.shape[r];while(o instanceof $o)o=o._def.innerType;t[r]=o}return new $t({...this._def,shape:()=>t})}keyof(){return Eq(Ne.objectKeys(this.shape))}};$t.create=(e,t)=>new $t({shape:()=>e,unknownKeys:"strip",catchall:pi.create(),typeName:fe.ZodObject,...De(t)});$t.strictCreate=(e,t)=>new $t({shape:()=>e,unknownKeys:"strict",catchall:pi.create(),typeName:fe.ZodObject,...De(t)});$t.lazycreate=(e,t)=>new $t({shape:e,unknownKeys:"strip",catchall:pi.create(),typeName:fe.ZodObject,...De(t)});yd=class yd extends Fe{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;let i=o.map((s)=>new Zr(s.ctx.common.issues));return G(t,{code:M.invalid_union,unionErrors:i}),de}if(t.common.async)return Promise.all(r.map(async(o)=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);else{let o=void 0,i=[];for(let a of r){let c={...t,common:{...t.common,issues:[]},parent:null},u=a._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;else if(u.status==="dirty"&&!o)o={result:u,ctx:c};if(c.common.issues.length)i.push(c.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map((a)=>new Zr(a));return G(t,{code:M.invalid_union,unionErrors:s}),de}}get options(){return this._def.options}};yd.create=(e,t)=>new yd({options:e,typeName:fe.ZodUnion,...De(t)});bw=class bw extends Fe{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.object)return G(t,{code:M.invalid_type,expected:W.object,received:t.parsedType}),de;let r=this.discriminator,n=t.data[r],o=this.optionsMap.get(n);if(!o)return G(t,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),de;if(t.common.async)return o._parseAsync({data:t.data,path:t.path,parent:t});else return o._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let o of t){let i=di(o.shape[e]);if(!i.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of i){if(n.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,o)}}return new bw({typeName:fe.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...De(r)})}};bd=class bd extends Fe{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(pw(o)||pw(i))return de;let s=yw(o.value,i.value);if(!s.valid)return G(r,{code:M.invalid_intersection_types}),de;if(mw(o)||mw(i))t.dirty();return{status:t.value,value:s.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>n(o,i));else return n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};bd.create=(e,t,r)=>new bd({left:e,right:t,typeName:fe.ZodIntersection,...De(r)});mi=class mi extends Fe{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==W.array)return G(r,{code:M.invalid_type,expected:W.array,received:r.parsedType}),de;if(r.data.length<this._def.items.length)return G(r,{code:M.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),de;if(!this._def.rest&&r.data.length>this._def.items.length)G(r,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let o=[...r.data].map((i,s)=>{let a=this._def.items[s]||this._def.rest;if(!a)return null;return a._parse(new Ln(r,i,r.path,s))}).filter((i)=>!!i);if(r.common.async)return Promise.all(o).then((i)=>ir.mergeArray(t,i));else return ir.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new mi({...this._def,rest:e})}};mi.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new mi({items:e,typeName:fe.ZodTuple,rest:null,...De(t)})};Oh=class Oh extends Fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==W.object)return G(r,{code:M.invalid_type,expected:W.object,received:r.parsedType}),de;let n=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)n.push({key:o._parse(new Ln(r,s,r.path,s)),value:i._parse(new Ln(r,r.data[s],r.path,s)),alwaysSet:s in r.data});if(r.common.async)return ir.mergeObjectAsync(t,n);else return ir.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof Fe)return new Oh({keyType:e,valueType:t,typeName:fe.ZodRecord,...De(r)});return new Oh({keyType:fi.create(),valueType:e,typeName:fe.ZodRecord,...De(t)})}};Fh=class Fh extends Fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==W.map)return G(r,{code:M.invalid_type,expected:W.map,received:r.parsedType}),de;let n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,a],c)=>({key:n._parse(new Ln(r,s,r.path,[c,"key"])),value:o._parse(new Ln(r,a,r.path,[c,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let a of i){let c=await a.key,u=await a.value;if(c.status==="aborted"||u.status==="aborted")return de;if(c.status==="dirty"||u.status==="dirty")t.dirty();s.set(c.value,u.value)}return{status:t.value,value:s}})}else{let s=new Map;for(let a of i){let{key:c,value:u}=a;if(c.status==="aborted"||u.status==="aborted")return de;if(c.status==="dirty"||u.status==="dirty")t.dirty();s.set(c.value,u.value)}return{status:t.value,value:s}}}};Fh.create=(e,t,r)=>new Fh({valueType:t,keyType:e,typeName:fe.ZodMap,...De(r)});Zc=class Zc extends Fe{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==W.set)return G(r,{code:M.invalid_type,expected:W.set,received:r.parsedType}),de;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)G(r,{code:M.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()}if(n.maxSize!==null){if(r.data.size>n.maxSize.value)G(r,{code:M.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty()}let o=this._def.valueType;function i(a){let c=new Set;for(let u of a){if(u.status==="aborted")return de;if(u.status==="dirty")t.dirty();c.add(u.value)}return{status:t.value,value:c}}let s=[...r.data.values()].map((a,c)=>o._parse(new Ln(r,a,r.path,c)));if(r.common.async)return Promise.all(s).then((a)=>i(a));else return i(s)}min(e,t){return new Zc({...this._def,minSize:{value:e,message:ne.toString(t)}})}max(e,t){return new Zc({...this._def,maxSize:{value:e,message:ne.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Zc.create=(e,t)=>new Zc({valueType:e,minSize:null,maxSize:null,typeName:fe.ZodSet,...De(t)});pd=class pd extends Fe{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.function)return G(t,{code:M.invalid_type,expected:W.function,received:t.parsedType}),de;function r(s,a){return $h({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,dd(),ys].filter((c)=>!!c),issueData:{code:M.invalid_arguments,argumentsError:a}})}function n(s,a){return $h({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,dd(),ys].filter((c)=>!!c),issueData:{code:M.invalid_return_type,returnTypeError:a}})}let o={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Qc){let s=this;return br(async function(...a){let c=new Zr([]),u=await s._def.args.parseAsync(a,o).catch((m)=>{throw c.addIssue(r(a,m)),c}),d=await Reflect.apply(i,this,u);return await s._def.returns._def.type.parseAsync(d,o).catch((m)=>{throw c.addIssue(n(d,m)),c})})}else{let s=this;return br(function(...a){let c=s._def.args.safeParse(a,o);if(!c.success)throw new Zr([r(a,c.error)]);let u=Reflect.apply(i,this,c.data),d=s._def.returns.safeParse(u,o);if(!d.success)throw new Zr([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new pd({...this._def,args:mi.create(e).rest(fa.create())})}returns(e){return new pd({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new pd({args:e?e:mi.create([]).rest(fa.create()),returns:t||fa.create(),typeName:fe.ZodFunction,...De(r)})}};xd=class xd extends Fe{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})}};xd.create=(e,t)=>new xd({getter:e,typeName:fe.ZodLazy,...De(t)});_d=class _d extends Fe{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return G(t,{received:t.data,code:M.invalid_literal,expected:this._def.value}),de}return{status:"valid",value:e.data}}get value(){return this._def.value}};_d.create=(e,t)=>new _d({value:e,typeName:fe.ZodLiteral,...De(t)});pa=class pa extends Fe{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return G(t,{expected:Ne.joinValues(r),received:t.parsedType,code:M.invalid_type}),de}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return G(t,{received:t.data,code:M.invalid_enum_value,options:r}),de}return br(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 pa.create(e,{...this._def,...t})}exclude(e,t=this._def){return pa.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};pa.create=Eq;vd=class vd extends Fe{_parse(e){let t=Ne.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==W.string&&r.parsedType!==W.number){let n=Ne.objectValues(t);return G(r,{expected:Ne.joinValues(n),received:r.parsedType,code:M.invalid_type}),de}if(!this._cache)this._cache=new Set(Ne.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=Ne.objectValues(t);return G(r,{received:r.data,code:M.invalid_enum_value,options:n}),de}return br(e.data)}get enum(){return this._def.values}};vd.create=(e,t)=>new vd({values:e,typeName:fe.ZodNativeEnum,...De(t)});Qc=class Qc extends Fe{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.promise&&t.common.async===!1)return G(t,{code:M.invalid_type,expected:W.promise,received:t.parsedType}),de;let r=t.parsedType===W.promise?t.data:Promise.resolve(t.data);return br(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Qc.create=(e,t)=>new Qc({type:e,typeName:fe.ZodPromise,...De(t)});Co=class Co extends Fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===fe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:(i)=>{if(G(r,i),i.fatal)t.abort();else t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let i=n.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async(s)=>{if(t.value==="aborted")return de;let a=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});if(a.status==="aborted")return de;if(a.status==="dirty")return Kc(a.value);if(t.value==="dirty")return Kc(a.value);return a});else{if(t.value==="aborted")return de;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});if(s.status==="aborted")return de;if(s.status==="dirty")return Kc(s.value);if(t.value==="dirty")return Kc(s.value);return s}}if(n.type==="refinement"){let i=(s)=>{let a=n.refinement(s,o);if(r.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(s.status==="aborted")return de;if(s.status==="dirty")t.dirty();return i(s.value),{status:t.value,value:s.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((s)=>{if(s.status==="aborted")return de;if(s.status==="dirty")t.dirty();return i(s.value).then(()=>({status:t.value,value:s.value}))})}if(n.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!da(i))return de;let s=n.transform(i.value,o);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((i)=>{if(!da(i))return de;return Promise.resolve(n.transform(i.value,o)).then((s)=>({status:t.value,value:s}))});Ne.assertNever(n)}};Co.create=(e,t,r)=>new Co({schema:e,typeName:fe.ZodEffects,effect:t,...De(r)});Co.createWithPreprocess=(e,t,r)=>new Co({schema:t,effect:{type:"preprocess",transform:e},typeName:fe.ZodEffects,...De(r)});$o=class $o extends Fe{_parse(e){if(this._getType(e)===W.undefined)return br(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};$o.create=(e,t)=>new $o({innerType:e,typeName:fe.ZodOptional,...De(t)});bs=class bs extends Fe{_parse(e){if(this._getType(e)===W.null)return br(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};bs.create=(e,t)=>new bs({innerType:e,typeName:fe.ZodNullable,...De(t)});wd=class wd extends Fe{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===W.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};wd.create=(e,t)=>new wd({innerType:e,typeName:fe.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...De(t)});Dd=class Dd extends Fe{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(fd(n))return n.then((o)=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Zr(r.common.issues)},input:r.data})}));else return{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Zr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Dd.create=(e,t)=>new Dd({innerType:e,typeName:fe.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...De(t)});Ph=class Ph extends Fe{_parse(e){if(this._getType(e)!==W.nan){let r=this._getOrReturnCtx(e);return G(r,{code:M.invalid_type,expected:W.nan,received:r.parsedType}),de}return{status:"valid",value:e.data}}};Ph.create=(e)=>new Ph({typeName:fe.ZodNaN,...De(e)});Jst=Symbol("zod_brand");xw=class xw extends Fe{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}};Ih=class Ih extends Fe{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(o.status==="aborted")return de;if(o.status==="dirty")return t.dirty(),Kc(o.value);else return this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();else{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(n.status==="aborted")return de;if(n.status==="dirty")return t.dirty(),{status:"dirty",value:n.value};else return this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new Ih({in:e,out:t,typeName:fe.ZodPipeline})}};Ed=class Ed extends Fe{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(da(n))n.value=Object.freeze(n.value);return n};return fd(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};Ed.create=(e,t)=>new Ed({innerType:e,typeName:fe.ZodReadonly,...De(t)});Xst={object:$t.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(fe||(fe={}));w=fi.create,k=Jc.create,Zst=Ph.create,Qst=Xc.create,be=Ch.create,eat=md.create,tat=kh.create,rat=hd.create,nat=gd.create,oat=Rh.create,Sd=fa.create,iat=pi.create,sat=Ah.create,te=So.create,U=$t.create,aat=$t.strictCreate,el=yd.create,_w=bw.create,cat=bd.create,lat=mi.create,ma=Oh.create,uat=Fh.create,dat=Zc.create,fat=pd.create,pat=xd.create,ze=_d.create,Ze=pa.create,mat=vd.create,hat=Qc.create,gat=Co.create,yat=$o.create,bat=bs.create,xat=Co.createWithPreprocess,_at=Ih.create});var vw=O(()=>{Sh();hw();xq();ud();Sq();Eh()});var en=O(()=>{vw();vw()});function S$e(e){return e.startsWith("v")?e:`v${e}`}var D$e,E$e,$q,Oat;var ww=O(()=>{en();D$e=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,E$e=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;$q=w().regex(D$e,"must be a semver version, optionally v-prefixed").transform(S$e),Oat=w().regex(E$e,"must be the canonical v-prefixed tag (vX.Y.Z)")});function Dw(e){return Th.includes(e)}var $$e,$d,Th,Cq,C$e,kq,k$e,Rq,R$e,A$e,Aq,O$e,Oq,Iat,Tat,Fq,F$e,Pq,P$e,Iq,Ew=20,Sw=500,I$e,Nat;var Cd=O(()=>{en();$$e=Ze(["pending","verified","approved","revoked"]),$d=Ze(["person","service","test"]),Th=$d.options;Cq={nemarOwner:"service",nemarAdmin:"service","test-admin":"service","test-owner":"service","cool-vibers":"test","test-user":"test","test-pending":"test","test-verified":"test","test-revoked":"test"},C$e=Ze(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),kq=C$e.options,k$e=Ze(["active","pending","revoked"]),Rq=U({field:w(),blocks:te(w()).optional(),set_on:te(w()).optional()}).passthrough(),R$e=U({id:k().int(),username:w().nullable(),email:w(),github_username:w().nullable(),role:w(),orcid:w().nullable().optional(),created_at:w().optional(),approved_at:w().nullable().optional(),dataset_count:k().int().optional(),sandbox_completed:be().optional(),sandbox_completed_at:w().nullable().optional(),sandbox_dataset_id:w().nullable().optional(),service_access:be().optional(),status:$$e.optional(),email_verified:be().optional(),orcid_verified:be().optional(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),profile_gaps:te(Rq).optional(),username_auto_assigned:be().optional(),account_kind:$d.optional()}).passthrough(),A$e=U({prefix:w(),created_at:w(),last_used_at:w().nullable()}).passthrough().nullable(),Aq=U({user:R$e,token:A$e.optional()}).passthrough(),O$e=U({id:k().int(),username:w().nullable(),email:w(),github_username:w().nullable(),status:w(),email_verified:k().int().nullable().optional(),role:w().nullable(),created_at:w(),approved_at:w().nullable().optional(),revoked_at:w().nullable().optional(),signup_source:w().nullable().optional(),service_access:k().int().nullable().optional(),service_access_granted_at:w().nullable().optional(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),orcid:w().nullable().optional(),upload_access_requested_at:w().nullable().optional(),account_kind:$d.optional()}).passthrough(),Oq=U({users:te(O$e),count:k().int()}).passthrough(),Iat=Ze(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),Tat=Ze(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),Fq=U({suggestion:w().nullable(),based_on:Ze(["name","unavailable","exhausted"])}).passthrough(),F$e=Ze(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),Pq=F$e.options,P$e=Ze(["invalid_github_username","city_required","country_required","empty_patch","username_too_short","username_too_long","username_charset","given_name_required","family_name_required","username_taken","username_locked","name_is_orcid_canonical","account_revoked","github_unavailable","same_email","code_expired","code_incorrect","orcid_already_have","orcid_unavailable"]),Iq=P$e.options,I$e=U({id:k().int(),email:w(),username:w().nullable(),role:w(),status:k$e,email_verified:be(),given_name:w().nullable(),family_name:w().nullable(),orcid:w().nullable(),orcid_verified:be(),github_username:w().nullable(),city:w().nullable(),country:w().nullable(),affiliation:w().nullable(),service_access:be(),service_access_granted_at:w().nullable(),upload_access_requested_at:w().nullable(),profile_gaps:te(Rq),username_auto_assigned:be()}).passthrough(),Nat=U({user:I$e.nullable()}).passthrough()});function Nq(e,t){if(e.zarr_index_url!=null&&e.zarr_status!=="ready")t.addIssue({code:M.custom,message:"zarr_index_url must be null/absent unless zarr_status is 'ready'",path:["zarr_index_url"]})}function jq(e,t){if(e.zarr_verified_at!=null&&e.zarr_verify_status==null)t.addIssue({code:M.custom,message:"zarr_verified_at must be null/absent unless zarr_verify_status is non-null",path:["zarr_verified_at"]})}var T$e="0.4.0",$w,tl,Tq,N$e,j$e,q$e,qq,Lat,Mq,Bat,hi,M$e,Nh,Uat;var Cw=O(()=>{en();ww();$w=Ze(["openneuro","nemar","gin","other"]),tl=el([ze(0),ze(1)]).nullable(),Tq=U({dataset_id:w(),id:w().optional(),name:w(),description:w().nullable().optional(),status:w(),visibility:w(),anonymous:k().int().nullable().optional(),concept_doi:w().nullable().optional(),doi:w().nullable().optional(),created_at:w(),updated_at:w().optional(),first_published_at:w().nullable().optional(),owner_username:w().nullable().optional(),source:w().nullable().optional(),modalities:w().optional(),participants:k().int().nonnegative(),tasks:w().optional(),authors:w().optional(),license:w().optional(),file_size:k().nonnegative(),file_size_formatted:w().optional(),total_files:k().nonnegative().nullable().optional(),num_citations:k().int().nonnegative().optional(),n_channels:k().int().nullable().optional(),electrode_system:w().nullable().optional(),has_hed:tl.optional(),hed_version:w().nullable().optional(),data_complete:tl.optional(),bytes_present:k().nonnegative().nullable().optional(),latest_version:$q.nullable().optional(),latest_version_at:w().nullable().optional(),subject_count:k().int().nullable().optional(),file_size_bytes:k().nullable().optional(),sessions_count:k().int().nullable().optional(),age_min:k().nullable().optional(),age_max:k().nullable().optional(),bids_version:w().nullable().optional(),zarr_status:Ze(["pending","ready","failed"]).nullable().optional(),zarr_store_count:k().int().nullable().optional(),zarr_converted_at:w().nullable().optional(),zarr_source_commit:w().nullable().optional(),zarr_errors:k().int().nullable().optional(),zarr_failure_count:k().int().nullable().optional(),zarr_deterministic:tl.optional(),zarr_failed_at:w().nullable().optional(),zarr_index_url:w().nullable().optional(),zarr_verify_status:Ze(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:w().nullable().optional(),zarr_requeue_at:w().nullable().optional(),anonymity_status:Ze(["verified","findings","unverifiable"]).nullable().optional(),anonymity_checked_at:w().nullable().optional(),anonymity_findings:w().nullable().optional(),anonymity_unchecked:w().nullable().optional(),total_recording_duration:k().nullable().optional(),recording_duration_min:k().nullable().optional(),recording_duration_max:k().nullable().optional(),recording_count:k().int().nullable().optional(),recordings_unavailable:k().int().nullable().optional(),channel_count_min:k().int().nullable().optional(),channel_count_max:k().int().nullable().optional(),sampling_frequency:k().nullable().optional(),power_line_frequency:k().nullable().optional(),eeg_reference:w().nullable().optional(),placement_scheme:w().nullable().optional()}).passthrough();N$e=Tq.superRefine((e,t)=>{Nq(e,t),jq(e,t)}),j$e=Tq.extend({file_size:k().nonnegative().nullable(),file_size_formatted:w().nullable().optional(),modalities:w().nullable().optional(),tasks:w().nullable().optional(),authors:w().nullable().optional(),license:w().nullable().optional(),owner_github:w().nullable().optional(),attestation_deposit_type:Ze(["owner","redistribution"]).nullable().optional(),attestation_key_status:Ze(["destroyed","retained"]).nullable().optional(),attestation_deidentified:tl.optional(),attestation_no_duplicate:tl.optional(),attestation_upstream_source:w().nullable().optional(),attestation_accepted_at:w().nullable().optional(),zarr_data_failures:U({count:k().int().nonnegative(),detail_ref:w(),compacted_by:w().optional(),pending:k().int().nonnegative().optional(),discovered:k().int().nonnegative().optional(),events_upload_failed:ze(!0).optional(),manifest_upload_failed:ze(!0).optional()}).passthrough().nullable().optional()}).passthrough().superRefine((e,t)=>{Nq(e,t),jq(e,t)}),q$e=U({id:w(),name:w(),modalities:w().nullable().optional(),participants:k().int().nullable().optional(),doi:w().nullable().optional(),tasks:w().nullable().optional(),authors:w().nullable().optional(),has_hed:tl.optional(),score:k().optional(),snippet:w().optional()}).passthrough(),qq=ma(w(),k().int().nonnegative()),Lat=U({datasets:te(N$e),count:k().int().nonnegative(),total_count:k().int().nonnegative().optional(),limit:k().int().optional(),offset:k().int().optional(),excluded_unknown:k().int().nonnegative().optional(),excluded_unknown_by_facet:qq.optional()}).passthrough(),Mq=U({results:te(q$e),count:k().int().nonnegative(),returned:k().int().nonnegative().optional(),offset:k().int().nonnegative().optional(),limit:k().int().optional(),candidate_ceiling:k().int().optional(),truncated:be().optional(),method:Ze(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:k().optional(),warning:w().optional(),excluded_unknown:k().int().nonnegative().optional(),excluded_unknown_by_facet:qq.optional()}).passthrough(),Bat=U({dataset:j$e}).passthrough(),hi=U({value:w(),count:k().int().nonnegative()}),M$e=U({values:te(hi),distinct_total:k().int().nonnegative(),truncated:be()}),Nh=U({"electrode-system":te(hi).optional(),source:te(hi).optional(),zarr:te(hi).optional(),powerline:te(hi).optional(),"bids-version":te(hi).optional(),"hed-version":te(hi).optional(),license:te(hi).optional(),modality:te(hi).optional(),task:M$e.optional(),warning:w().optional()}).passthrough(),Uat=U({schema_version:ze(T$e),doc_type:ze("dataset"),dataset_id:w().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:w(),source:$w,recording_modality:te(w()).min(1),description:w().nullable().optional(),bids_version:w().nullable().optional(),license:w().nullable().optional()}).passthrough()});var L$e,Gat,Hat,Wat,Kat;var Lq=O(()=>{en();L$e=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,Gat=w().regex(L$e,"ORCID must be in format 0000-0000-0000-000X"),Hat=Ze(["found","no_public_name","lookup_failed"]),Wat=Ze(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing"]),Kat=Ze(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var B$e,Bq,kd="https://nemar.org/settings",Xat,U$e,z$e,V$e,Uq,zq;var kw=O(()=>{en();B$e=Ze(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),Bq=B$e.options,Xat={orcid_in_use:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${kd}).`,orcid_already_linked:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${kd}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${kd}), then link it here.`,email_in_use:`That email address already belongs to a NEMAR account. Sign in to that account instead, or change its address first (Settings, ${kd}).`,github_in_use:`That GitHub account is already linked to a NEMAR account. Sign in to that account instead, or change its GitHub username first (Settings, ${kd}).`,identity_conflict_remains:"The collision that flagged this account is still there. Resolve it on the other account first (change its email or GitHub username, or unlink its ORCID iD), or delete that account, then clear the flag."},U$e=Ze(["orcid","email","github"]),z$e=U({id:k().int(),username:w().nullable(),email:w(),created_at:w(),has_oauth_identity:be(),dataset_count:k().int(),identity_conflict:k().int(),canonical:be()}).passthrough(),V$e=U({kind:U$e,value:w(),canonical_user_id:k().int(),accounts:te(z$e)}).passthrough(),Uq=U({groups:te(V$e),group_count:k().int(),flagged_count:k().int()}).passthrough(),zq=U({ok:ze(!0),id:k().int(),cleared:be()}).passthrough()});var Rw=120,Vq=64,Aw="unnamed machine",G$e=25,jh,Gq,rl,Hq,ect,tct,Wq,H$e,W$e,Kq,Ow,Yq,rct,nct,qh,Mh;var Lh=O(()=>{en();jh=Ze(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),Gq={authorization_pending:"Waiting for you to authorize this machine in the browser.",slow_down:"Polling too quickly; the CLI will slow down automatically.",expired_token:"The code expired. Run `nemar auth login` again for a new one.",access_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",invalid_grant:"That code is no longer valid. Run `nemar auth login` again for a new one."},rl=Ze(["device_code_unknown","device_code_expired","device_code_used","device_code_denied","account_pending","account_revoked","identity_conflict","service_account","person_account","too_many_keys","key_not_found"]),Hq=rl.options,ect={device_code_unknown:"That code was not found. Check the code shown in your terminal, or run `nemar auth login` again for a new one.",device_code_expired:"The code expired. Run `nemar auth login` again for a new one.",device_code_used:"That code has already been used. Run `nemar auth login` again for a new one.",device_code_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",account_pending:"Verify your email address first. Check your inbox for the NEMAR verification code, then authorize again.",account_revoked:"Your NEMAR account access has been revoked. Contact the NEMAR team if you think this is a mistake.",identity_conflict:"This account shares an identifier with another NEMAR account and cannot sign in until that is resolved. Fix it in Settings on nemar.org or contact the NEMAR team.",service_account:"This is a service or test account, and it cannot sign in this way. Ask an owner to create a key for it with `nemar admin keys create`.",person_account:"This account belongs to a person. A person creates their own keys with `nemar auth login` or in Settings on nemar.org.",too_many_keys:`This account already has ${G$e} active keys. Revoke one in Settings on nemar.org or with \`nemar auth keys\`, then try again.`,key_not_found:"That key was not found on this account, or it is already revoked. Run `nemar auth keys` to see the active ones."},tct=U({error:rl,message:w()}).passthrough(),Wq=U({device_code:w(),user_code:w(),verification_uri:w(),verification_uri_complete:w(),expires_in:k().int(),interval:k().int()}).passthrough(),H$e=_w("error",[U({error:ze("authorization_pending"),message:w()}).passthrough(),U({error:ze("slow_down"),message:w()}).passthrough()]),W$e=_w("error",[U({error:ze("expired_token"),reason:rl,message:w()}).passthrough(),U({error:ze("access_denied"),reason:rl,message:w()}).passthrough(),U({error:ze("invalid_grant"),reason:rl,message:w()}).passthrough()]),Kq=el([H$e,W$e]),Ow=U({id:k().int(),name:w().nullable(),prefix:w(),created_at:w(),last_used_at:w().nullable(),current:be()}).passthrough(),Yq=U({api_key:w(),key:Ow,user:U({username:w().nullable(),email:w(),github_username:w().nullable(),role:w(),sandbox_completed:be(),sandbox_dataset_id:w().nullable()}).passthrough()}).passthrough(),rct=U({user_code:w(),machine_name:w(),requested_at:w(),expires_in:k().int(),account:U({username:w().nullable(),email_masked:w()}).passthrough(),refusal:U({code:rl,message:w()}).passthrough().nullable()}).passthrough(),nct=U({ok:ze(!0),machine_name:w()}).passthrough(),qh=U({keys:te(Ow)}).passthrough(),Mh=U({api_key:w(),key:Ow}).passthrough()});function Pt(e){return Ct[e]}function gi(e,t){return e.replace(/\{(\w+)\}/g,(r,n)=>Object.hasOwn(t,n)?t[n]:r)}var Ct;var nl=O(()=>{Ct={"tier.unverified.label":"Email not verified","tier.base.label":"Base access","tier.upload.label":"Upload access","tier.unverified.lede":"Verify your email address to activate your account.","upload_access.section.title":"Upload access","upload_access.section.lede":"A one-time admin grant. Reviewed against export-control and local-jurisdiction rules.","upload_access.state.granted":"Granted","upload_access.state.requested":"Requested","upload_access.state.not_requested":"Not requested","upload_access.invite.title":"Want to contribute a dataset?","upload_access.invite.body":"Browsing, searching and downloading are open to your account already. Uploading needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once.","upload_access.gate.title":"Ask for upload access first","upload_access.gate.body":"Your account can browse, search and download everything public already. Uploading needs one extra grant: an admin checks your GitHub handle and where you\u2019re based against export-control and local-jurisdiction rules. You ask once, and it is answered by email.","upload_access.request.cta":"Request upload access","upload_access.request.form_body":"Tell us what you plan to deposit. An admin reviews this alongside your name, username, GitHub handle and location, then grants access once.","upload_access.request.why_label":"What do you intend to upload?","upload_access.request.why_hint":"Describe what you intend to upload in 20-500 characters","upload_access.requested.title":"Your request is with an admin","upload_access.requested.lede":"An admin is reviewing your request.","upload_access.requested.lede_dated":"An admin is reviewing your request from {date}.","upload_access.requested.body.upload":"We\u2019ll email you when there\u2019s a decision, and this page will let you upload as soon as it\u2019s granted.","upload_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","upload_access.requested.cta":"See the request","upload_access.granted.body":"You can upload datasets from the upload page. Publishing one is a separate, per-dataset review you start from your dashboard.","upload_access.unverified.body":"Verify your email address first \u2014 the review happens over email.","upload_access.docs_link":"How upload access works","gap.sentence":"{label} is missing: needed {blocks}.","gap.set_on.both":"Set it in {web} or run `{cli}`.","gap.set_on.web":"Set it in {web}.","gap.blocks.verified":"to activate your account","gap.blocks.upload_access":"to request upload access","gap.blocks.publication":"to publish a dataset","gap.blocks.unknown":"to finish setting up your account","gap.blocks.noun.verified":"account activation","gap.blocks.noun.upload_access":"upload access","gap.blocks.noun.publication":"publication","gap.set_on.default_web":"Settings","gap.field.email_verified.label":"A verified email address","gap.field.username.label":"Username","gap.field.given_name.label":"Given name","gap.field.family_name.label":"Family name","gap.field.orcid_verified.label":"Verified ORCID iD","gap.field.github_username.label":"GitHub handle","gap.field.city.label":"City","gap.field.country.label":"Country","gap.field.why.label":"A description of what you intend to upload","gap.field.email_verified.set_on.web":"the verify step on your dashboard","gap.field.email_verified.set_on.cli":"nemar auth resend-verification","gap.field.username.set_on.web":"Settings","gap.field.username.set_on.cli":"nemar auth profile set-username","gap.field.given_name.set_on.web":"Settings","gap.field.given_name.set_on.cli":"nemar auth profile set-name","gap.field.family_name.set_on.web":"Settings","gap.field.family_name.set_on.cli":"nemar auth profile set-name","gap.field.given_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.family_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.orcid_verified.set_on.web":"Settings","gap.field.orcid_verified.set_on.cli":"nemar auth profile orcid link","gap.field.github_username.set_on.web":"Settings","gap.field.github_username.set_on.cli":"nemar auth profile set-github","gap.field.city.set_on.web":"Settings","gap.field.city.set_on.cli":"nemar auth profile set-location","gap.field.country.set_on.web":"Settings","gap.field.country.set_on.cli":"nemar auth profile set-location","gap.field.why.set_on.web":"the request form in Settings","gap.field.why.set_on.cli":"nemar auth request-upload-access","gaps.title":"What is still missing","gaps.none":"Nothing outstanding \u2014 every field NEMAR needs is filled in.","gaps.nudge.title":"Your profile isn\u2019t finished yet","gaps.nudge.cta":"Complete your profile","gaps.upload.title":"Before you can ask, your account still needs:","gaps.request.title":"Finish these first:","gaps.admin.title":"Still missing","gaps.admin.item":"{label} \u2014 blocks {blocks}","gaps.admin.none":"Nothing missing \u2014 every field the request needs is filled in.","gaps.admin.not_loaded":"Not loaded \u2014 open the user page to see what is still missing.","onboarding.username.auto_assigned.title":"We chose your username from your name","onboarding.username.auto_assigned.body":"Your account needed a username to be listed as a dataset owner, so one was made from your name when you signed in. You can change it once, here, until an admin grants you upload access.","welcome.unverified.title":"Verify your email address","welcome.unverified.body":"Authorizing with ORCID created your NEMAR account and signed you in. One step left: enter the 6-digit code we emailed you. That activates the account \u2014 no admin approval is involved.","welcome.active.title":"Your account is active","welcome.active.body":"Authorizing with ORCID created your NEMAR account and signed you in. There is no separate sign-up step and no approval queue: browse, search, and your dashboard all work right now.","welcome.upload_access.title":"Ask for upload access when you\u2019re ready to contribute","welcome.upload_access.body":"Reading is open to every verified account. Uploading and compute need one extra grant, because an admin has to check your GitHub handle and location against export-control and local-jurisdiction rules first. You ask once, from Settings.","cli.gaps.section.title":"Profile","cli.gaps.unknown":"not checked: run 'nemar auth status --refresh'","cli.gaps.unreported":"not reported by this backend","cli.gap.set_on.cli_only":"Run `{cli}`.","cli.gap.field.sandbox.label":"Sandbox training","cli.gap.blocks.sandbox":"to upload a dataset from the CLI","cli.gap.field.sandbox.set_on.cli":"nemar sandbox","cli.gaps.sandbox_unchecked":"Sandbox training could not be confirmed with the server. Run `nemar sandbox status --refresh`, then `nemar sandbox` if it is still outstanding.","cli.upload.preflight.title":"Upload access is not granted yet","cli.upload.preflight.body":"Browsing, searching and downloading are open to your account already. Uploading needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once.","cli.upload_access.cta":"Ask for it with `nemar auth request-upload-access`.","cli.upload.preflight.unchecked":"Upload access could not be checked ({reason}); continuing.","cli.upload.preflight.gaps_unknown":"Could not determine what is still missing; run `nemar auth profile` for the list.","cli.upload.preflight.dry_run":"Continuing anyway: --dry-run uploads nothing."}});function Y$e(e){return e==="verified"||e==="upload_access"||e==="publication"}function ol(e){return(e??"").trim().length===0}function J$e(e){return e==="service"||e==="test"}function Zq(e,t={}){let r=t.orcidVerified===!0,n=Object.hasOwn(Bh,e)?Bh[e]:void 0;if(!n)return{field:e,label:e,blocks:t.blocks??[],setOnWeb:Ct["gap.set_on.default_web"],setOnCli:null,known:!1};let o=r&&n.orcidWebKey!==void 0;return{field:e,blocks:t.blocks??n.blocks,label:Ct[n.labelKey],setOnWeb:Ct[o?n.orcidWebKey:n.webKey],setOnCli:o||n.cliKey===null?null:Ct[n.cliKey],known:!0}}function Jq(e){let t=Fw.indexOf(e);return t===-1?Fw.length:t}function Qq(e,t={}){return e.map((r)=>Zq(r,{orcidVerified:t.orcidVerified}))}function Uh(e,t={}){return e.filter((r)=>!!r&&typeof r.field==="string").map((r)=>{let n=Array.isArray(r.blocks)?r.blocks.filter(Y$e):[];return Zq(r.field,{orcidVerified:t.orcidVerified,blocks:n.length>0?n:void 0})}).sort((r,n)=>Jq(r.field)-Jq(n.field))}function Pw(e){let t=e.blocks[0],r=t?Ct[K$e[t]]:Ct["gap.blocks.unknown"],n=gi(Ct["gap.sentence"],{label:"",blocks:r}).trimStart(),o=e.setOnCli?gi(Ct["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):gi(Ct["gap.set_on.web"],{web:e.setOnWeb});return`${n} ${o}`}function e9(e){return`${e.label} ${Pw(e)}`}function zh(){let e=gi(Ct["gap.sentence"],{label:Xq.label,blocks:Ct["cli.gap.blocks.sandbox"]}),t=gi(Ct["cli.gap.set_on.cli_only"],{cli:Xq.command});return`${e} ${t}`}function t9(){return Ct["cli.gaps.sandbox_unchecked"]}var Bh,Fw,act,K$e,Xq;var il=O(()=>{nl();Bh={email_verified:{blocks:["verified","upload_access"],labelKey:"gap.field.email_verified.label",webKey:"gap.field.email_verified.set_on.web",cliKey:"gap.field.email_verified.set_on.cli",isMissing:(e)=>e.status==="pending"||e.email_verified===!1},username:{blocks:["upload_access"],labelKey:"gap.field.username.label",webKey:"gap.field.username.set_on.web",cliKey:"gap.field.username.set_on.cli",isMissing:(e)=>e.username!==void 0&&ol(e.username)},given_name:{blocks:["upload_access","publication"],labelKey:"gap.field.given_name.label",webKey:"gap.field.given_name.set_on.web",cliKey:"gap.field.given_name.set_on.cli",orcidWebKey:"gap.field.given_name.set_on.web.orcid",isMissing:(e)=>ol(e.given_name)},family_name:{blocks:["upload_access","publication"],labelKey:"gap.field.family_name.label",webKey:"gap.field.family_name.set_on.web",cliKey:"gap.field.family_name.set_on.cli",orcidWebKey:"gap.field.family_name.set_on.web.orcid",isMissing:(e)=>ol(e.family_name)},orcid_verified:{blocks:["upload_access"],labelKey:"gap.field.orcid_verified.label",webKey:"gap.field.orcid_verified.set_on.web",cliKey:"gap.field.orcid_verified.set_on.cli",isMissing:(e)=>e.orcid_verified!==!0&&!J$e(e.account_kind)},github_username:{blocks:["upload_access","publication"],labelKey:"gap.field.github_username.label",webKey:"gap.field.github_username.set_on.web",cliKey:"gap.field.github_username.set_on.cli",isMissing:(e)=>ol(e.github_username)},city:{blocks:["upload_access"],labelKey:"gap.field.city.label",webKey:"gap.field.city.set_on.web",cliKey:"gap.field.city.set_on.cli",isMissing:(e)=>ol(e.city)},country:{blocks:["upload_access"],labelKey:"gap.field.country.label",webKey:"gap.field.country.set_on.web",cliKey:"gap.field.country.set_on.cli",isMissing:(e)=>ol(e.country)},why:{blocks:["upload_access"],labelKey:"gap.field.why.label",webKey:"gap.field.why.set_on.web",cliKey:"gap.field.why.set_on.cli",isMissing:null}},Fw=Object.keys(Bh),act=Fw.filter((e)=>Bh[e].isMissing!==null),K$e={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",publication:"gap.blocks.publication"};Xq={field:"sandbox",label:Ct["cli.gap.field.sandbox.label"],command:Ct["cli.gap.field.sandbox.set_on.cli"]}});function Wh(e,t){let r=e.sss!==void 0;if(e.derived!==r)t.addIssue({code:M.custom,path:["sss"],message:e.derived?"derived is true but sss is absent (ADR 0028: the two travel together)":"sss is present but derived is false (ADR 0028: the two travel together)"})}var xr,Vh,r9,Gh,X$e,Hh,Z$e,Q$e,eCe,tCe,rCe,uct,nCe,dct,oCe,fct;var Iw=O(()=>{en();xr=/^[a-z]{2}[0-9]{6}$/,Vh=/^[0-9a-f]{40}$/,r9=U({name:w(),modality:w().nullable().optional(),rate:k().nullable().optional(),n_channels:k().int().nonnegative().nullable().optional(),n_samples:k().int().nonnegative().nullable().optional(),duration_s:k().nonnegative().nullable().optional(),source_rate_hz:k().nullable().optional(),n_view_levels:k().int().nonnegative().optional(),view_chunk_columns:k().int().positive().optional(),chunk_samples:k().int().positive().optional(),shard_samples:k().int().positive().optional()}).passthrough(),Gh=U({converted:k().int().nonnegative().optional(),relabelled:k().int().nonnegative().optional(),kept_importer_unit:k().int().nonnegative().optional(),units_column_present:be().optional(),sidecar:w().optional(),sidecar_supplied:be().optional(),unmatched_channels:k().int().nonnegative().optional(),unmatched_case_only:k().int().positive().optional(),matched_case_only:k().int().positive().optional(),matched_case_only_examples:te(w()).max(5).optional(),unmatched_raw_label:k().int().positive().optional(),unmatched_examples:te(w()).max(5).optional()}).passthrough(),X$e=U({channels_tsv:k().int().positive(),in_file:k().int().nonnegative(),in_store:k().int().nonnegative()}).passthrough(),Hh=U({applied:be().optional(),method:w().optional(),calibration:w().optional(),cross_talk:w().optional(),mne_version:w().optional()}).passthrough();Z$e=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),updated_utc:w().optional(),source_tree:ze("raw"),derived:be(),modalities:te(w()).optional(),groups:te(r9).optional(),power_line_frequency:k().nullable().optional(),event_description_count:k().int().nonnegative().optional(),n_events:k().int().nonnegative().optional(),trial_types:ma(w(),k().int().nonnegative()).optional(),units_report:Gh.optional(),channels_tsv_read_error:be().optional(),channels_tsv_count_mismatch:X$e.optional(),split_members:te(w()).optional(),sss:Hh.optional()}).passthrough().superRefine(Wh),Q$e=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr").optional(),code:w(),reason:w(),detail:w().nullable().optional(),attempts:k().int().nonnegative().optional()}).passthrough(),eCe=Ze(["infra_failure","memory_budget","not_attempted"]),tCe=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),reason:eCe,attempts:k().int().nonnegative(),last_error:w().nullable().optional(),last_attempt_utc:w().nullable().optional()}).passthrough(),rCe=U({level0:ze("<zarr>/<group>/0"),view:ze("<zarr>/<group>/view/<L>"),view_levels:ze("1..n_view_levels from the group attrs"),scale_offset:ze("level-0 array attrs scale[] and offset[]; physical = digital * scale + offset"),events:ze("<data_base>events.parquet").optional()}).passthrough(),uct=U({format:ze("nemar-zarr-index"),format_version:ze(3),dataset_id:w().regex(xr,"NEMAR dataset id (nm/on/xx band)"),contract_base:w().regex(/^https:\/\//,"must be https"),data_base:w().regex(/^https:\/\//,"must be https"),data_base_kind:ze("s3-public"),s3_uri:w().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:w().min(1),s3_anonymous:be(),source_commit:w().regex(Vh,"must be a full 40-hex SHA"),engine_version:w().min(1),biosigio_version:w().nullable().optional(),updated_utc:w(),discovered_count:k().int().nonnegative(),store_count:k().int().nonnegative(),n_recordings:k().int().nonnegative(),errors:k().int().nonnegative(),failure_count:k().int().nonnegative(),pending_count:k().int().nonnegative(),stores:te(Z$e),failures:te(Q$e),pending:te(tCe),doi:w().nullable().optional(),license:w().nullable().optional(),citation:w().nullable().optional(),hed_version:w().nullable().optional(),events_parquet:w().regex(/^https:\/\//,"must be https").optional(),events_row_count:k().int().nonnegative().optional(),layout:rCe}).passthrough(),nCe=U({name:w(),configuration:ma(w(),Sd()).optional()}).passthrough(),dct=U({zarr_format:ze(3),node_type:ze("array"),shape:te(k().int().nonnegative()),data_type:w(),chunk_grid:U({name:w(),configuration:ma(w(),Sd()).optional()}).passthrough(),codecs:te(nCe),fill_value:Sd().optional(),attributes:ma(w(),Sd()).optional(),dimension_names:te(w().nullable()).optional()}).passthrough(),oCe=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),groups:te(r9).optional(),modalities:te(w()).optional()}).passthrough(),fct=U({format:ze("nemar-zarr-index"),format_version:k().int(),dataset_id:w().regex(xr,"NEMAR dataset id (nm/on/xx band)"),source_commit:w(),stores:te(oCe)}).passthrough()});function n9(e){let t=e.unit?` (${e.unit})`:"";switch(e.valueKind){case"enum":return`${e.label} -- comma-separated, one or more of: ${(e.enumValues??[]).join(", ")}`;case"number":return`${e.label}${t} -- range (e.g. 10..50, 10.., ..50, or 10)`;case"bytes":return`${e.label}${t} -- range with optional units (e.g. 10gb..2tb, 500mb.., ..1gb; bare = bytes)`;case"duration":return`${e.label}${t} -- range with optional units (e.g. 30m..2h, 100h.., ..90s; bare = seconds)`;case"text":return`${e.label} -- substring match`;case"version":return`${e.label} -- exact or prefix match`}}var iCe,sCe,aCe,cCe,ko,hct;var Kh=O(()=>{Cw();iCe=["10-05","10-10","10-20","biosemi","egi-geodesic","other"],sCe=["50","60"],aCe=["ready","pending","failed"],cCe=$w.options,ko=[{key:"subjects",flag:"--subjects",queryParam:"subjects",valueKind:"number",label:"Subject count",unit:"subjects"},{key:"channels",flag:"--channels",queryParam:"channels",valueKind:"number",label:"Channel count",unit:"channels"},{key:"sessions",flag:"--sessions",queryParam:"sessions",valueKind:"number",label:"Session count",unit:"sessions"},{key:"size",flag:"--size",queryParam:"size",valueKind:"bytes",label:"Dataset size"},{key:"files",flag:"--files",queryParam:"files",valueKind:"number",label:"File count",unit:"files"},{key:"citations",flag:"--citations",queryParam:"citations",valueKind:"number",label:"Citation count",unit:"citations"},{key:"duration",flag:"--duration",queryParam:"duration",valueKind:"duration",label:"Total recording duration"},{key:"recording-length",flag:"--recording-length",queryParam:"recording_length",valueKind:"duration",label:"Per-recording duration"},{key:"recordings",flag:"--recordings",queryParam:"recordings",valueKind:"number",label:"Recording count",unit:"recordings"},{key:"unavailable",flag:"--unavailable",queryParam:"unavailable",valueKind:"number",label:"Unavailable recording count",unit:"recordings"},{key:"age",flag:"--age",queryParam:"age",valueKind:"number",label:"Participant age",unit:"years"},{key:"rate",flag:"--rate",queryParam:"rate",valueKind:"number",label:"Sampling rate",unit:"Hz"},{key:"powerline",flag:"--powerline",queryParam:"powerline",valueKind:"enum",label:"Power line frequency",enumValues:sCe},{key:"reference",flag:"--reference",queryParam:"reference",valueKind:"text",label:"EEG reference"},{key:"placement",flag:"--placement",queryParam:"placement",valueKind:"text",label:"Electrode placement scheme"},{key:"electrode-system",flag:"--electrode-system",queryParam:"electrode_system",valueKind:"enum",label:"Electrode system",enumValues:iCe},{key:"source",flag:"--source",queryParam:"source",valueKind:"enum",label:"Source archive",enumValues:cCe},{key:"zarr",flag:"--zarr",queryParam:"zarr",valueKind:"enum",label:"Zarr conversion status",enumValues:aCe},{key:"bids-version",flag:"--bids-version",queryParam:"bids_version",valueKind:"version",label:"BIDS version"},{key:"hed-version",flag:"--hed-version",queryParam:"hed_version",valueKind:"version",label:"HED version"}],hct=new Map(ko.map((e)=>[e.key,e]))});var lCe,_ct,uCe,c9,Rd,o9,dCe,l9,fCe=20,pCe=100,mCe,u9,hCe,vct,wct,gCe,Dct,Ect,yCe,bCe,xCe,Sct,_Ce=50,vCe=500,$ct,wCe,DCe,Cct,ECe=1000,SCe=5000,i9=8,$Ce=100,CCe=32,s9,kct,kCe,RCe,ACe,Rct,OCe=800,FCe=4000,Act,Oct,Tw=60,Nw=64,a9,PCe=86400,ICe=4096,Fct,TCe,NCe,Pct;var d9=O(()=>{en();Kh();Iw();lCe=U({dataset_id:w().regex(xr),name:w(),doi:w().nullable().optional(),license:w().nullable().optional(),modalities:te(w()).optional(),tasks:te(w()).optional(),subject_count:k().int().nonnegative().nullable().optional(),has_hed:el([ze(0),ze(1)]).nullable().optional(),hed_version:w().nullable().optional(),store_count:k().int().nonnegative().nullable().optional(),recording_count:k().int().nonnegative().nullable().optional(),recordings_unavailable:k().int().nonnegative().nullable().optional(),total_recording_duration:k().nullable().optional(),zarr_converted_at:w().nullable().optional(),zarr_source_commit:w().nullable().optional(),zarr_errors:k().int().nonnegative().nullable().optional(),zarr_verify_status:Ze(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:w().nullable().optional(),index_url:w().nullable().optional()}).passthrough(),_ct=U({format:ze("nemar-zarr-catalog"),format_version:k().int(),generated_utc:w(),contract_base:w(),count:k().int().nonnegative(),datasets:te(lCe)}).passthrough(),uCe=["verified","failed","unverifiable"],c9=Ze(uCe).nullable(),Rd=U({dataset_id:w().regex(xr),doi:w().nullable(),license:w().nullable(),citation:w().nullable(),source_commit:w().regex(Vh),index_etag:w().nullable(),engine_version:w(),source_tree:ze("raw"),derived:be(),sss:Hh.optional(),lossy:be(),dtype:w().nullable(),effective_rate_hz:k().nullable(),source_rate_hz:k().nullable(),units_report:Gh.nullable().optional(),zarr_verify_status:c9,note:w().nullable().optional()}).passthrough().superRefine(Wh),o9=U({start:k().int().nonnegative(),end:k().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),dCe=U({python_zarr:w(),zarrita:w(),python_browser:w()}).passthrough(),l9=U({contract_base:w(),data_base:w(),s3_uri:w(),s3_region:w(),s3_anonymous:be(),zarr:w(),group:w(),level:el([ze("0"),k().int().positive()]),array_path:w(),dtype:w().nullable(),codecs:te(Sd()).optional(),chunk_samples:k().int().positive().nullable(),shard_samples:k().int().positive().nullable(),n_channels:k().int().nonnegative().nullable(),sample_slice:o9.optional(),channel_slice:o9.optional(),scale_offset:w(),how_to:dCe}).passthrough(),mCe=Object.fromEntries(ko.map((e)=>[e.queryParam,w().optional()])),u9={modality:w().optional(),task:w().optional(),has_hed:be().optional(),has_zarr:be().optional(),author:w().optional(),has_doi:be().optional(),has_zarr_verified:be().optional(),data_complete:be().optional(),recent:k().int().positive().optional(),license:w().optional()},hCe=Object.keys(u9),vct=[...hCe,...ko.map((e)=>e.queryParam)],wct=U({query:w().optional(),...u9,include_unknown:be().optional(),...mCe,limit:k().int().positive().max(pCe).default(fCe)}).passthrough(),gCe=U({dataset_id:w().regex(xr),name:w(),doi:w().nullable().optional(),license:w().nullable().optional(),modalities:te(w()).optional(),tasks:te(w()).optional(),subject_count:k().int().nullable().optional(),has_hed:be().nullable().optional(),has_zarr:be()}).passthrough(),Dct=U({results:te(gCe),count:k().int().nonnegative(),limit:k().int(),note:w().nullable().optional(),truncated:be().optional()}).passthrough(),Ect=U({dataset_id:w().regex(xr)}).passthrough(),yCe=["list_recordings","get_events","render_overview","read_window"],bCe=U({next_cheapest_tool:Ze(yCe),reason:w()}).passthrough(),xCe=["pending","ready","failed"],Sct=U({dataset_id:w().regex(xr),name:w(),doi:w().nullable(),license:w().nullable(),citation:w().nullable(),modalities:te(w()).optional(),tasks:te(w()).optional(),subject_count:k().int().nullable().optional(),has_hed:be().nullable().optional(),hed_version:w().nullable().optional(),recording_count:k().int().nullable().optional(),total_recording_duration_s:k().nullable().optional(),zarr_status:Ze(xCe).nullable().optional(),zarr_verify_status:c9.optional(),zarr_source_commit:w().nullable().optional(),zarr_store_count:k().int().nullable().optional(),cost_hint:bCe}).passthrough(),$ct=U({dataset_id:w().regex(xr),modality:w().optional(),min_duration_s:k().nonnegative().optional(),include_derived:be().default(!1),limit:k().int().positive().max(vCe).default(_Ce),offset:k().int().nonnegative().default(0)}).passthrough(),wCe=U({name:w(),modality:w().nullable().optional(),rate:k().nullable().optional(),n_channels:k().int().nullable().optional(),duration_s:k().nullable().optional(),n_view_levels:k().int().nonnegative().nullable().optional(),n_samples:k().int().nonnegative().nullable().optional(),view_chunk_columns:k().int().positive().nullable().optional()}).passthrough(),DCe=U({path:w(),zarr:w(),source_tree:ze("raw"),derived:be(),groups:te(wCe).optional(),n_events:k().int().nonnegative().optional(),sss:Hh.optional(),units_report:Gh.optional()}).passthrough().superRefine(Wh),Cct=U({dataset_id:w().regex(xr),source_commit:w().regex(Vh).nullable(),recordings:te(DCe),total_count:k().int().nonnegative(),excluded_derived_count:k().int().nonnegative(),limit:k().int(),offset:k().int(),index_format_version:k().int(),discovered_count:k().int().nonnegative().nullable(),failure_count:k().int().nonnegative().nullable(),pending_count:k().int().nonnegative().nullable(),excluded_legacy_non_raw_count:k().int().nonnegative(),note:w().nullable().optional(),envelope:Rd.optional()}).passthrough(),s9=w().min(1).max(64),kct=U({dataset_id:w().regex(xr),recording:w(),group:w().optional(),limit:k().int().positive().max(SCe).default(ECe),offset:k().int().nonnegative().default(0),where:ma(s9,te(el([w(),k()])).min(1).max($Ce)).refine((e)=>{let t=Object.keys(e).length;return t>=1&&t<=i9},{message:`where names 1 to ${i9} columns`}).optional(),columns:te(s9).min(1).max(CCe).optional()}).passthrough(),kCe=U({store_path:w(),group_name:w(),onset_s:k(),duration_s:k().nullable().optional(),sample_index:k().int().nonnegative(),trial_type:w().nullable().optional(),value:el([w(),k()]).nullable().optional(),hed:w().nullable().optional()}).passthrough(),RCe=kCe.partial().required({onset_s:!0,sample_index:!0}),ACe=U({name:w(),distinct_count:k().int().nonnegative(),null_count:k().int().nonnegative(),values:te(U({value:w(),count:k().int().positive()}).passthrough()).nullable()}).passthrough(),Rct=U({dataset_id:w().regex(xr),recording:w(),events:te(RCe),source:Ze(["events_parquet","events_tsv_fallback"]),estimated:be(),total_count:k().int().nonnegative(),limit:k().int(),offset:k().int(),truncated:be(),note:w().nullable().optional(),columns_summary:te(ACe).optional(),envelope:Rd.optional()}).passthrough(),Act=U({dataset_id:w().regex(xr),recording:w(),group:w().optional(),width_px:k().int().positive().max(FCe).default(OCe)}).passthrough(),Oct=U({dataset_id:w().regex(xr),recording:w(),group:w(),level:k().int().positive(),width_px:k().int().positive(),height_px:k().int().positive(),mime_type:ze("image/png"),columns_read:k().int().nonnegative(),chunks_read:k().int().nonnegative(),bytes_read:k().int().nonnegative(),envelope:Rd.optional()}).passthrough(),a9=Tw*Nw,Fct=U({dataset_id:w().regex(xr),recording:w(),group:w().optional(),start_s:k().nonnegative().default(0),duration_s:k().positive().max(PCe).default(10),channels:te(k().int().nonnegative()).max(ICe).optional(),taste:be().default(!1)}).passthrough().superRefine((e,t)=>{if(!e.taste)return;if(!e.channels||e.channels.length===0){t.addIssue({code:M.custom,message:"taste requires channels: name the channel indices you want (list_recordings reports each group's n_channels), or omit taste for a recipe",path:["channels"]});return}if(e.duration_s>Tw)t.addIssue({code:M.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${Tw} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>Nw)t.addIssue({code:M.custom,message:`taste channels (${e.channels.length}) exceeds the ${Nw}-channel cap; omit taste for a recipe instead`,path:["channels"]});let r=e.duration_s*e.channels.length;if(r>a9)t.addIssue({code:M.custom,message:`taste exceeds the cap of ${a9} channel-seconds (duration_s x channels = ${r}); omit taste for a recipe instead`,path:["duration_s"]})}),TCe=U({mode:ze("recipe"),recipe:l9,envelope:Rd}).passthrough(),NCe=U({mode:ze("taste"),start_s:k(),duration_s:k(),channels:te(k().int()),sample_rate_hz:k(),values:te(te(k())),recipe:l9,chunks_read:k().int().nonnegative(),bytes_read:k().int().nonnegative(),filled_ranges:te(U({start_sample:k().int().nonnegative(),end_sample:k().int().nonnegative(),start_s:k(),end_s:k()}).passthrough()),note:w().nullable().optional(),envelope:Rd}).passthrough(),Pct=_w("mode",[TCe,NCe])});var sl=O(()=>{ww();Cd();Cw();Lq();kw();Lh();nl();il();Iw();d9()});function Yh(e){return e?qCe:xs}var xs,jCe,qCe,jw;var Jh=O(()=>{xs=["ci_check","enrichment_check","s3_public_read","repo_public","tag_protect","doi_create","update_metadata","update_readme","create_tag","create_release","upload_to_zenodo","publish_doi","version_doi","s3_lock","sync_nemar","notify_user"],jCe=["update_metadata","update_readme","upload_to_zenodo","publish_doi"],qCe=xs.filter((e)=>!jCe.includes(e));jw={ci_check:"Check CI",enrichment_check:"Enrichment check",s3_public_read:"S3 public read",repo_public:"Make catalog row public",tag_protect:"Tag protection",doi_create:"Create DOI",update_metadata:"Update metadata",update_readme:"Update README",create_tag:"Create version tag",create_release:"Create GitHub release",upload_to_zenodo:"Upload to Zenodo (no-op)",publish_doi:"Publish DOI (irreversible)",version_doi:"Version DOI + manifest",s3_lock:"S3 Object Lock",sync_nemar:"Sync NEMAR (no-op)",notify_user:"Notify user"}});function Xh(e){let t=[],r="",n="start",o=!1;for(let i of e)switch(i){case"\\":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(o)r+=i;n="property",o=!o;break}case".":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(o){o=!1,r+=i;break}if(qw.has(r))return[];t.push(r),r="",n="property";break}case"[":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(o){o=!1,r+=i;break}if(n==="property"){if(qw.has(r))return[];t.push(r),r=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw Error("Invalid character after an index")}default:{if(n==="index"&&!MCe.has(i))throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(n==="start")n="property";if(o)o=!1,r+="\\";r+=i}}if(o)r+="\\";switch(n){case"property":{if(qw.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function Mw(e,t){if(typeof t!=="number"&&Array.isArray(e)){let r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return!1}function f9(e,t){if(Mw(e,t))throw Error("Cannot use string index")}function p9(e,t,r){if(!ha(e)||typeof t!=="string")return r===void 0?e:r;let n=Xh(t);if(n.length===0)return r;for(let o=0;o<n.length;o++){let i=n[o];if(Mw(e,i))e=o===n.length-1?void 0:null;else e=e[i];if(e===void 0||e===null){if(o!==n.length-1)return r;break}}return e===void 0?r:e}function Lw(e,t,r){if(!ha(e)||typeof t!=="string")return e;let n=e,o=Xh(t);for(let i=0;i<o.length;i++){let s=o[i];if(f9(e,s),i===o.length-1)e[s]=r;else if(!ha(e[s]))e[s]=typeof o[i+1]==="number"?[]:{};e=e[s]}return n}function m9(e,t){if(!ha(e)||typeof t!=="string")return!1;let r=Xh(t);for(let n=0;n<r.length;n++){let o=r[n];if(f9(e,o),n===r.length-1)return delete e[o],!0;if(e=e[o],!ha(e))return!1}}function h9(e,t){if(!ha(e)||typeof t!=="string")return!1;let r=Xh(t);if(r.length===0)return!1;for(let n of r){if(!ha(e)||!(n in e)||Mw(e,n))return!1;e=e[n]}return!0}var ha=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},qw,MCe;var g9=O(()=>{qw=new Set(["__proto__","prototype","constructor"]),MCe=new Set("0123456789")});import _t from"path";import y9 from"os";import Bw from"process";function zw(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(Bw.platform==="darwin")return LCe(e);if(Bw.platform==="win32")return BCe(e);return UCe(e)}var _s,Uw,al,LCe=(e)=>{let t=_t.join(_s,"Library");return{data:_t.join(t,"Application Support",e),config:_t.join(t,"Preferences",e),cache:_t.join(t,"Caches",e),log:_t.join(t,"Logs",e),temp:_t.join(Uw,e)}},BCe=(e)=>{let t=al.APPDATA||_t.join(_s,"AppData","Roaming"),r=al.LOCALAPPDATA||_t.join(_s,"AppData","Local");return{data:_t.join(r,e,"Data"),config:_t.join(t,e,"Config"),cache:_t.join(r,e,"Cache"),log:_t.join(r,e,"Log"),temp:_t.join(Uw,e)}},UCe=(e)=>{let t=_t.basename(_s);return{data:_t.join(al.XDG_DATA_HOME||_t.join(_s,".local","share"),e),config:_t.join(al.XDG_CONFIG_HOME||_t.join(_s,".config"),e),cache:_t.join(al.XDG_CACHE_HOME||_t.join(_s,".cache"),e),log:_t.join(al.XDG_STATE_HOME||_t.join(_s,".local","state"),e),temp:_t.join(Uw,t,e)}};var b9=O(()=>{_s=y9.homedir(),Uw=y9.tmpdir(),{env:al}=Bw});var zCe=(e,t)=>{let{onError:r}=t;return function(...o){return e.apply(void 0,o).catch(r)}},Ro;var x9=O(()=>{Ro=zCe});var VCe=(e,t)=>{let{onError:r}=t;return function(...o){try{return e.apply(void 0,o)}catch(i){return r(i)}}},Bn;var _9=O(()=>{Bn=VCe});var v9=250;var w9=()=>{};var GCe=(e,t)=>{let{isRetriable:r}=t;return function(o){let{timeout:i}=o,s=o.interval??v9,a=Date.now()+i;return function c(...u){return e.apply(void 0,u).catch((d)=>{if(!r(d))throw d;if(Date.now()>=a)throw d;let f=Math.round(s*Math.random());if(f>0)return new Promise((p)=>setTimeout(p,f)).then(()=>c.apply(void 0,u));else return c.apply(void 0,u)})}}},Ao;var D9=O(()=>{w9();Ao=GCe});var HCe=(e,t)=>{let{isRetriable:r}=t;return function(o){let{timeout:i}=o,s=Date.now()+i;return function(...c){while(!0)try{return e.apply(void 0,c)}catch(u){if(!r(u))throw u;if(Date.now()>=s)throw u;continue}}}},Oo;var E9=O(()=>{Oo=HCe});var Vw=O(()=>{x9();_9();D9();E9()});var Ad,Gw;var S9=O(()=>{Hw();Ad={isChangeErrorOk:(e)=>{if(!Ad.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!$9&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Ad.isNodeError(e))return!1;let{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM")return!0;return!1},onChangeError:(e)=>{if(!Ad.isNodeError(e))throw e;if(Ad.isChangeErrorOk(e))return;throw e}},Gw=Ad});import C9 from"process";var Od,Tr,$9,Zt;var Hw=O(()=>{S9();Od={onError:Gw.onChangeError},Tr={onError:()=>{return}},$9=C9.getuid?!C9.getuid():!1,Zt={isRetriable:Gw.isRetriableError}});import Ke from"fs";import{promisify as sr}from"util";var WCe,Gt;var Ww=O(()=>{Vw();Vw();Hw();WCe={attempt:{chmod:Ro(sr(Ke.chmod),Od),chown:Ro(sr(Ke.chown),Od),close:Ro(sr(Ke.close),Tr),fsync:Ro(sr(Ke.fsync),Tr),mkdir:Ro(sr(Ke.mkdir),Tr),realpath:Ro(sr(Ke.realpath),Tr),stat:Ro(sr(Ke.stat),Tr),unlink:Ro(sr(Ke.unlink),Tr),chmodSync:Bn(Ke.chmodSync,Od),chownSync:Bn(Ke.chownSync,Od),closeSync:Bn(Ke.closeSync,Tr),existsSync:Bn(Ke.existsSync,Tr),fsyncSync:Bn(Ke.fsync,Tr),mkdirSync:Bn(Ke.mkdirSync,Tr),realpathSync:Bn(Ke.realpathSync,Tr),statSync:Bn(Ke.statSync,Tr),unlinkSync:Bn(Ke.unlinkSync,Tr)},retry:{close:Ao(sr(Ke.close),Zt),fsync:Ao(sr(Ke.fsync),Zt),open:Ao(sr(Ke.open),Zt),readFile:Ao(sr(Ke.readFile),Zt),rename:Ao(sr(Ke.rename),Zt),stat:Ao(sr(Ke.stat),Zt),write:Ao(sr(Ke.write),Zt),writeFile:Ao(sr(Ke.writeFile),Zt),closeSync:Oo(Ke.closeSync,Zt),fsyncSync:Oo(Ke.fsyncSync,Zt),openSync:Oo(Ke.openSync,Zt),readFileSync:Oo(Ke.readFileSync,Zt),renameSync:Oo(Ke.renameSync,Zt),statSync:Oo(Ke.statSync,Zt),writeSync:Oo(Ke.writeSync,Zt),writeFileSync:Oo(Ke.writeFileSync,Zt)}},Gt=WCe});import ga from"process";var k9="utf8",Kw=438,R9=511,A9,O9,F9,P9=1000,I9,vlt,Yw=128;var Jw=O(()=>{A9={},O9=ga.geteuid?ga.geteuid():-1,F9=ga.getegid?ga.getegid():-1,I9=!!ga.getuid,vlt=ga.getuid?!ga.getuid():!1});var T9=(e)=>e instanceof Error&&("code"in e),Xw=(e)=>typeof e==="string",Zh=(e)=>e===void 0;var N9=()=>{};var j9=()=>{};import q9 from"process";var M9,Qh;var Zw=O(()=>{M9=q9.platform==="linux",Qh=q9.platform==="win32"});var Qw,L9;var B9=O(()=>{Zw();Qw=["SIGHUP","SIGINT","SIGTERM"];if(!Qh)Qw.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(M9)Qw.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");L9=Qw});import cl from"process";class U9{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(e)=>{if(this.exited)return;this.exited=!0;for(let t of this.callbacks)t();if(e)if(Qh&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))cl.kill(cl.pid,"SIGTERM");else cl.kill(cl.pid,e)},this.hook=()=>{cl.once("exit",()=>this.exit());for(let e of L9)try{cl.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var z9;var V9=O(()=>{Zw();B9();z9=new U9});var KCe,G9;var H9=O(()=>{V9();KCe=z9.register,G9=KCe});import YCe from"path";var tn,Fd;var W9=O(()=>{Ww();H9();Jw();tn={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),r=Date.now().toString().slice(-10),n="tmp-",o=`.tmp-${r}${t}`;return`${e}${o}`},get:(e,t,r=!0)=>{let n=tn.truncate(t(e));if(n in tn.store)return tn.get(e,t,r);return tn.store[n]=r,[n,()=>delete tn.store[n]]},purge:(e)=>{if(!tn.store[e])return;delete tn.store[e],Gt.attempt.unlink(e)},purgeSync:(e)=>{if(!tn.store[e])return;delete tn.store[e],Gt.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in tn.store)tn.purgeSync(e)},truncate:(e)=>{let t=YCe.basename(e);if(t.length<=Yw)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-Yw;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};G9(tn.purgeSyncAll);Fd=tn});import JCe from"path";function e1(e,t,r=A9){if(Xw(r))return e1(e,t,{encoding:r});let o={timeout:r.timeout??P9},i=null,s=null,a=null;try{let c=Gt.attempt.realpathSync(e),u=!!c;e=c||e,[s,i]=Fd.get(e,r.tmpCreate||Fd.create,r.tmpPurge!==!1);let d=I9&&Zh(r.chown),f=Zh(r.mode);if(u&&(d||f)){let m=Gt.attempt.statSync(e);if(m){if(r={...r},d)r.chown={uid:m.uid,gid:m.gid};if(f)r.mode=m.mode}}if(!u){let m=JCe.dirname(e);Gt.attempt.mkdirSync(m,{mode:R9,recursive:!0})}if(a=Gt.retry.openSync(o)(s,"w",r.mode||Kw),r.tmpCreated)r.tmpCreated(s);if(Xw(t))Gt.retry.writeSync(o)(a,t,0,r.encoding||k9);else if(!Zh(t))Gt.retry.writeSync(o)(a,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)Gt.retry.fsyncSync(o)(a);else Gt.attempt.fsync(a);if(Gt.retry.closeSync(o)(a),a=null,r.chown&&(r.chown.uid!==O9||r.chown.gid!==F9))Gt.attempt.chownSync(s,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==Kw)Gt.attempt.chmodSync(s,r.mode);try{Gt.retry.renameSync(o)(s,e)}catch(m){if(!T9(m))throw m;if(m.code!=="ENAMETOOLONG")throw m;Gt.retry.renameSync(o)(s,Fd.truncate(e))}i(),s=null}finally{if(a)Gt.attempt.closeSync(a);if(s)Fd.purge(s)}}var K9=O(()=>{Ww();Jw();N9();j9();W9()});var Id=y(function(X9){Object.defineProperty(X9,"__esModule",{value:!0});X9.regexpCode=X9.getEsmExportName=X9.getProperty=X9.safeStringify=X9.stringify=X9.strConcat=X9.addCodeArg=X9.str=X9._=X9.nil=X9._Code=X9.Name=X9.IDENTIFIER=X9._CodeOrName=void 0;class eg{}X9._CodeOrName=eg;X9.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class ll extends eg{constructor(e){super();if(!X9.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}X9.Name=ll;class Un extends eg{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof ll)t[r.str]=(t[r.str]||0)+1;return t},{})}}X9._Code=Un;X9.nil=new Un("");function Y9(e,...t){let r=[e[0]],n=0;while(n<t.length)r1(r,t[n]),r.push(e[++n]);return new Un(r)}X9._=Y9;var t1=new Un("+");function J9(e,...t){let r=[Pd(e[0])],n=0;while(n<t.length)r.push(t1),r1(r,t[n]),r.push(t1,Pd(e[++n]));return XCe(r),new Un(r)}X9.str=J9;function r1(e,t){if(t instanceof Un)e.push(...t._items);else if(t instanceof ll)e.push(t);else e.push(eke(t))}X9.addCodeArg=r1;function XCe(e){let t=1;while(t<e.length-1){if(e[t]===t1){let r=ZCe(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function ZCe(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof ll||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof ll))return`"${e}${t.slice(1)}`;return}function QCe(e,t){return t.emptyStr()?e:e.emptyStr()?t:J9`${e}${t}`}X9.strConcat=QCe;function eke(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Pd(Array.isArray(e)?e.join(","):e)}function tke(e){return new Un(Pd(e))}X9.stringify=tke;function Pd(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}X9.safeStringify=Pd;function rke(e){return typeof e=="string"&&X9.IDENTIFIER.test(e)?new Un(`.${e}`):Y9`[${e}]`}X9.getProperty=rke;function nke(e){if(typeof e=="string"&&X9.IDENTIFIER.test(e))return new Un(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}X9.getEsmExportName=nke;function oke(e){return new Un(e.toString())}X9.regexpCode=oke});var s1=y(function(tM){Object.defineProperty(tM,"__esModule",{value:!0});tM.ValueScope=tM.ValueScopeName=tM.Scope=tM.varKinds=tM.UsedValueState=void 0;var Nr=Id();class Q9 extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var rg;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(rg||(tM.UsedValueState=rg={}));tM.varKinds={const:new Nr.Name("const"),let:new Nr.Name("let"),var:new Nr.Name("var")};class o1{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof Nr.Name?e:this.name(e)}name(e){return new Nr.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}tM.Scope=o1;class i1 extends Nr.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=Nr._`.${new Nr.Name(t)}[${r}]`}}tM.ValueScopeName=i1;var yke=Nr._`\n`;class eM extends o1{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?yke:Nr.nil}}get(){return this._scope}name(e){return new i1(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:o}=n,i=(r=t.key)!==null&&r!==void 0?r:t.ref,s=this._values[o];if(s){let u=s.get(i);if(u)return u}else s=this._values[o]=new Map;s.set(i,n);let a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:o,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return Nr._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let o=Nr.nil;for(let i in e){let s=e[i];if(!s)continue;let a=r[i]=r[i]||new Map;s.forEach((c)=>{if(a.has(c))return;a.set(c,rg.Started);let u=t(c);if(u){let d=this.opts.es5?tM.varKinds.var:tM.varKinds.const;o=Nr._`${o}${d} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))o=Nr._`${o}${u}${this.opts._n}`;else throw new Q9(c);a.set(c,rg.Completed)})}return o}}tM.ValueScope=eM});var Ee=y(function(jr){Object.defineProperty(jr,"__esModule",{value:!0});jr.or=jr.and=jr.not=jr.CodeGen=jr.operators=jr.varKinds=jr.ValueScopeName=jr.ValueScope=jr.Scope=jr.Name=jr.regexpCode=jr.stringify=jr.getProperty=jr.nil=jr.strConcat=jr.str=jr._=void 0;var Le=Id(),zn=s1(),vs=Id();Object.defineProperty(jr,"_",{enumerable:!0,get:function(){return vs._}});Object.defineProperty(jr,"str",{enumerable:!0,get:function(){return vs.str}});Object.defineProperty(jr,"strConcat",{enumerable:!0,get:function(){return vs.strConcat}});Object.defineProperty(jr,"nil",{enumerable:!0,get:function(){return vs.nil}});Object.defineProperty(jr,"getProperty",{enumerable:!0,get:function(){return vs.getProperty}});Object.defineProperty(jr,"stringify",{enumerable:!0,get:function(){return vs.stringify}});Object.defineProperty(jr,"regexpCode",{enumerable:!0,get:function(){return vs.regexpCode}});Object.defineProperty(jr,"Name",{enumerable:!0,get:function(){return vs.Name}});var cg=s1();Object.defineProperty(jr,"Scope",{enumerable:!0,get:function(){return cg.Scope}});Object.defineProperty(jr,"ValueScope",{enumerable:!0,get:function(){return cg.ValueScope}});Object.defineProperty(jr,"ValueScopeName",{enumerable:!0,get:function(){return cg.ValueScopeName}});Object.defineProperty(jr,"varKinds",{enumerable:!0,get:function(){return cg.varKinds}});jr.operators={GT:new Le._Code(">"),GTE:new Le._Code(">="),LT:new Le._Code("<"),LTE:new Le._Code("<="),EQ:new Le._Code("==="),NEQ:new Le._Code("!=="),NOT:new Le._Code("!"),OR:new Le._Code("||"),AND:new Le._Code("&&"),ADD:new Le._Code("+")};class ws{optimizeNodes(){return this}optimizeNames(e,t){return this}}class nM extends ws{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?zn.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=dl(this.rhs,e,t);return this}get names(){return this.rhs instanceof Le._CodeOrName?this.rhs.names:{}}}class l1 extends ws{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof Le.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=dl(this.rhs,e,t),this}get names(){let e=this.lhs instanceof Le.Name?{}:{...this.lhs.names};return ag(e,this.rhs)}}class oM extends l1{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class iM extends ws{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class sM extends ws{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class aM extends ws{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class cM extends ws{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=dl(this.code,e,t),this}get names(){return this.code instanceof Le._CodeOrName?this.code.names:{}}}class lg extends ws{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let o=r[n];if(o.optimizeNames(e,t))continue;vke(e,o.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ya(e,t.names),{})}}class Ds extends lg{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class lM extends lg{}class Td extends Ds{}Td.kind="else";class yi extends Ds{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Td(r):r}if(t){if(e===!1)return t instanceof yi?t:t.nodes;if(this.nodes.length)return this;return new yi(mM(e),t instanceof yi?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=dl(this.condition,e,t),this}get names(){let e=super.names;if(ag(e,this.condition),this.else)ya(e,this.else.names);return e}}yi.kind="if";class ul extends Ds{}ul.kind="for";class uM extends ul{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=dl(this.iteration,e,t),this}get names(){return ya(super.names,this.iteration.names)}}class dM extends ul{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?zn.varKinds.var:this.varKind,{name:r,from:n,to:o}=this;return`for(${t} ${r}=${n}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){let e=ag(super.names,this.from);return ag(e,this.to)}}class a1 extends ul{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=dl(this.iterable,e,t),this}get names(){return ya(super.names,this.iterable.names)}}class ng extends Ds{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}ng.kind="func";class og extends lg{render(e){return"return "+super.render(e)}}og.kind="return";class fM extends Ds{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)ya(e,this.catch.names);if(this.finally)ya(e,this.finally.names);return e}}class ig extends Ds{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}ig.kind="catch";class sg extends Ds{render(e){return"finally"+super.render(e)}}sg.kind="finally";class pM{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
85
85
  `:""},this._extScope=e,this._scope=new zn.Scope({parent:e}),this._nodes=[new lM]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let o=this._scope.toName(t);if(r!==void 0&&n)this._constants[o.str]=r;return this._leafNode(new nM(e,o,r)),o}const(e,t,r){return this._def(zn.varKinds.const,e,t,r)}let(e,t,r){return this._def(zn.varKinds.let,e,t,r)}var(e,t,r){return this._def(zn.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new l1(e,t,r))}add(e,t){return this._leafNode(new oM(e,jr.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==Le.nil)this._leafNode(new cM(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),Le.addCodeArg(t,n)}return t.push("}"),new Le._Code(t)}if(e,t,r){if(this._blockNode(new yi(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new yi(e))}else(){return this._elseNode(new Td)}endIf(){return this._endBlockNode(yi,Td)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new uM(e),t)}forRange(e,t,r,n,o=this.opts.es5?zn.varKinds.var:zn.varKinds.let){let i=this._scope.toName(e);return this._for(new dM(o,i,t,r),()=>n(i))}forOf(e,t,r,n=zn.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let i=t instanceof Le.Name?t:this.var("_arr",t);return this.forRange("_i",0,Le._`${i}.length`,(s)=>{this.var(o,Le._`${i}[${s}]`),r(o)})}return this._for(new a1("of",n,o,t),()=>r(o))}forIn(e,t,r,n=this.opts.es5?zn.varKinds.var:zn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,Le._`Object.keys(${t})`,r);let o=this._scope.toName(e);return this._for(new a1("in",n,o,t),()=>r(o))}endFor(){return this._endBlockNode(ul)}label(e){return this._leafNode(new iM(e))}break(e){return this._leafNode(new sM(e))}return(e){let t=new og;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(og)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new fM;if(this._blockNode(n),this.code(e),t){let o=this.name("e");this._currNode=n.catch=new ig(o),t(o)}if(r)this._currNode=n.finally=new sg,this.code(r);return this._endBlockNode(ig,sg)}throw(e){return this._leafNode(new aM(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=Le.nil,r,n){if(this._blockNode(new ng(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(ng)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof yi))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}jr.CodeGen=pM;function ya(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function ag(e,t){return t instanceof Le._CodeOrName?ya(e,t.names):e}function dl(e,t,r){if(e instanceof Le.Name)return n(e);if(!o(e))return e;return new Le._Code(e._items.reduce((i,s)=>{if(s instanceof Le.Name)s=n(s);if(s instanceof Le._Code)i.push(...s._items);else i.push(s);return i},[]));function n(i){let s=r[i.str];if(s===void 0||t[i.str]!==1)return i;return delete t[i.str],s}function o(i){return i instanceof Le._Code&&i._items.some((s)=>s instanceof Le.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function vke(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function mM(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:Le._`!${c1(e)}`}jr.not=mM;var wke=hM(jr.operators.AND);function Dke(...e){return e.reduce(wke)}jr.and=Dke;var Eke=hM(jr.operators.OR);function Ske(...e){return e.reduce(Eke)}jr.or=Ske;function hM(e){return(t,r)=>t===Le.nil?r:r===Le.nil?t:Le._`${c1(t)} ${e} ${c1(r)}`}function c1(e){return e instanceof Le.Name?e:Le._`(${e})`}});var Te=y(function(EM){Object.defineProperty(EM,"__esModule",{value:!0});EM.checkStrictMode=EM.getErrorPath=EM.Type=EM.useFunc=EM.setEvaluated=EM.evaluatedPropsToName=EM.mergeEvaluated=EM.eachItem=EM.unescapeJsonPointer=EM.escapeJsonPointer=EM.escapeFragment=EM.unescapeFragment=EM.schemaRefOrVal=EM.schemaHasRulesButRef=EM.schemaHasRules=EM.checkUnknownRules=EM.alwaysValidSchema=EM.toHash=void 0;var st=Ee(),Rke=Id();function Ake(e){let t={};for(let r of e)t[r]=!0;return t}EM.toHash=Ake;function Oke(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return xM(e,t),!_M(t,e.self.RULES.all)}EM.alwaysValidSchema=Oke;function xM(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let o=n.RULES.keywords;for(let i in t)if(!o[i])DM(e,`unknown keyword: "${i}"`)}EM.checkUnknownRules=xM;function _M(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}EM.schemaHasRules=_M;function Fke(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}EM.schemaHasRulesButRef=Fke;function Pke({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return st._`${r}`}return st._`${e}${t}${st.getProperty(n)}`}EM.schemaRefOrVal=Pke;function Ike(e){return vM(decodeURIComponent(e))}EM.unescapeFragment=Ike;function Tke(e){return encodeURIComponent(d1(e))}EM.escapeFragment=Tke;function d1(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}EM.escapeJsonPointer=d1;function vM(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}EM.unescapeJsonPointer=vM;function Nke(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}EM.eachItem=Nke;function yM({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let c=s===void 0?i:s instanceof st.Name?(i instanceof st.Name?e(o,i,s):t(o,i,s),s):i instanceof st.Name?(t(o,s,i),i):r(i,s);return a===st.Name&&!(c instanceof st.Name)?n(o,c):c}}EM.mergeEvaluated={props:yM({mergeNames:(e,t,r)=>e.if(st._`${r} !== true && ${t} !== undefined`,()=>{e.if(st._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,st._`${r} || {}`).code(st._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(st._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,st._`${r} || {}`),f1(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:wM}),items:yM({mergeNames:(e,t,r)=>e.if(st._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,st._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(st._`${r} !== true`,()=>e.assign(r,t===!0?!0:st._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function wM(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",st._`{}`);if(t!==void 0)f1(e,r,t);return r}EM.evaluatedPropsToName=wM;function f1(e,t,r){Object.keys(r).forEach((n)=>e.assign(st._`${t}${st.getProperty(n)}`,!0))}EM.setEvaluated=f1;var bM={};function jke(e,t){return e.scopeValue("func",{ref:t,code:bM[t.code]||(bM[t.code]=new Rke._Code(t.code))})}EM.useFunc=jke;var u1;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(u1||(EM.Type=u1={}));function qke(e,t,r){if(e instanceof st.Name){let n=t===u1.Num;return r?n?st._`"[" + ${e} + "]"`:st._`"['" + ${e} + "']"`:n?st._`"/" + ${e}`:st._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?st.getProperty(e).toString():"/"+d1(e)}EM.getErrorPath=qke;function DM(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}EM.checkStrictMode=DM});var bn=y(function($M){Object.defineProperty($M,"__esModule",{value:!0});var ar=Ee(),rRe={data:new ar.Name("data"),valCxt:new ar.Name("valCxt"),instancePath:new ar.Name("instancePath"),parentData:new ar.Name("parentData"),parentDataProperty:new ar.Name("parentDataProperty"),rootData:new ar.Name("rootData"),dynamicAnchors:new ar.Name("dynamicAnchors"),vErrors:new ar.Name("vErrors"),errors:new ar.Name("errors"),this:new ar.Name("this"),self:new ar.Name("self"),scope:new ar.Name("scope"),json:new ar.Name("json"),jsonPos:new ar.Name("jsonPos"),jsonLen:new ar.Name("jsonLen"),jsonPart:new ar.Name("jsonPart")};$M.default=rRe});var Nd=y(function(AM){Object.defineProperty(AM,"__esModule",{value:!0});AM.extendErrors=AM.resetErrorsCount=AM.reportExtraError=AM.reportError=AM.keyword$DataError=AM.keywordError=void 0;var Ve=Ee(),dg=Te(),_r=bn();AM.keywordError={message:({keyword:e})=>Ve.str`must pass "${e}" keyword validation`};AM.keyword$DataError={message:({keyword:e,schemaType:t})=>t?Ve.str`"${e}" keyword must be ${t} ($data)`:Ve.str`"${e}" keyword is invalid ($data)`};function oRe(e,t=AM.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,c=RM(e,t,r);if(n!==null&&n!==void 0?n:s||a)CM(i,c);else kM(o,Ve._`[${c}]`)}AM.reportError=oRe;function iRe(e,t=AM.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=RM(e,t,r);if(CM(o,a),!(i||s))kM(n,_r.default.vErrors)}AM.reportExtraError=iRe;function sRe(e,t){e.assign(_r.default.errors,t),e.if(Ve._`${_r.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(Ve._`${_r.default.vErrors}.length`,t),()=>e.assign(_r.default.vErrors,null)))}AM.resetErrorsCount=sRe;function aRe({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw Error("ajv implementation error");let s=e.name("err");e.forRange("i",o,_r.default.errors,(a)=>{if(e.const(s,Ve._`${_r.default.vErrors}[${a}]`),e.if(Ve._`${s}.instancePath === undefined`,()=>e.assign(Ve._`${s}.instancePath`,Ve.strConcat(_r.default.instancePath,i.errorPath))),e.assign(Ve._`${s}.schemaPath`,Ve.str`${i.errSchemaPath}/${t}`),i.opts.verbose)e.assign(Ve._`${s}.schema`,r),e.assign(Ve._`${s}.data`,n)})}AM.extendErrors=aRe;function CM(e,t){let r=e.const("err",t);e.if(Ve._`${_r.default.vErrors} === null`,()=>e.assign(_r.default.vErrors,Ve._`[${r}]`),Ve._`${_r.default.vErrors}.push(${r})`),e.code(Ve._`${_r.default.errors}++`)}function kM(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;if(o.$async)r.throw(Ve._`new ${e.ValidationError}(${t})`);else r.assign(Ve._`${n}.errors`,t),r.return(!1)}var ba={keyword:new Ve.Name("keyword"),schemaPath:new Ve.Name("schemaPath"),params:new Ve.Name("params"),propertyName:new Ve.Name("propertyName"),message:new Ve.Name("message"),schema:new Ve.Name("schema"),parentSchema:new Ve.Name("parentSchema")};function RM(e,t,r){let{createErrors:n}=e.it;if(n===!1)return Ve._`{}`;return cRe(e,t,r)}function cRe(e,t,r={}){let{gen:n,it:o}=e,i=[lRe(o,r),uRe(e,r)];return dRe(e,t,i),n.object(...i)}function lRe({errorPath:e},{instancePath:t}){let r=t?Ve.str`${e}${dg.getErrorPath(t,dg.Type.Str)}`:e;return[_r.default.instancePath,Ve.strConcat(_r.default.instancePath,r)]}function uRe({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:Ve.str`${t}/${e}`;if(r)o=Ve.str`${o}${dg.getErrorPath(r,dg.Type.Str)}`;return[ba.schemaPath,o]}function dRe(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:s,it:a}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:f}=a;if(n.push([ba.keyword,o],[ba.params,typeof t=="function"?t(e):t||Ve._`{}`]),c.messages)n.push([ba.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([ba.schema,s],[ba.parentSchema,Ve._`${d}${f}`],[_r.default.data,i]);if(u)n.push([ba.propertyName,u])}});var TM=y(function(PM){Object.defineProperty(PM,"__esModule",{value:!0});PM.boolOrEmptySchema=PM.topBoolOrEmptySchema=void 0;var gRe=Nd(),yRe=Ee(),bRe=bn(),xRe={message:"boolean schema is false"};function _Re(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)FM(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(bRe.default.data);else t.assign(yRe._`${n}.errors`,null),t.return(!0)}PM.topBoolOrEmptySchema=_Re;function vRe(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),FM(e);else r.var(t,!0)}PM.boolOrEmptySchema=vRe;function FM(e,t){let{gen:r,data:n}=e;gRe.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},xRe,void 0,t)}});var m1=y(function(NM){Object.defineProperty(NM,"__esModule",{value:!0});NM.getRules=NM.isJSONType=void 0;var DRe=["string","number","integer","boolean","null","object","array"],ERe=new Set(DRe);function SRe(e){return typeof e=="string"&&ERe.has(e)}NM.isJSONType=SRe;function $Re(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}NM.getRules=$Re});var h1=y(function(LM){Object.defineProperty(LM,"__esModule",{value:!0});LM.shouldUseRule=LM.shouldUseGroup=LM.schemaHasRulesForType=void 0;function kRe({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&qM(e,n)}LM.schemaHasRulesForType=kRe;function qM(e,t){return t.rules.some((r)=>MM(e,r))}LM.shouldUseGroup=qM;function MM(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((n)=>e[n]!==void 0))}LM.shouldUseRule=MM});var jd=y(function(GM){Object.defineProperty(GM,"__esModule",{value:!0});GM.reportTypeError=GM.checkDataTypes=GM.checkDataType=GM.coerceAndCheckDataType=GM.getJSONTypes=GM.getSchemaTypes=GM.DataType=void 0;var ORe=m1(),FRe=h1(),PRe=Nd(),Ce=Ee(),UM=Te(),fl;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(fl||(GM.DataType=fl={}));function IRe(e){let t=zM(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}GM.getSchemaTypes=IRe;function zM(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(ORe.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}GM.getJSONTypes=zM;function TRe(e,t){let{gen:r,data:n,opts:o}=e,i=NRe(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&FRe.schemaHasRulesForType(e,t[0]));if(s){let a=y1(t,n,o.strictNumbers,fl.Wrong);r.if(a,()=>{if(i.length)jRe(e,t,i);else b1(e)})}return s}GM.coerceAndCheckDataType=TRe;var VM=new Set(["string","number","integer","boolean","null"]);function NRe(e,t){return t?e.filter((r)=>VM.has(r)||t==="array"&&r==="array"):[]}function jRe(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",Ce._`typeof ${o}`),a=n.let("coerced",Ce._`undefined`);if(i.coerceTypes==="array")n.if(Ce._`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,Ce._`${o}[0]`).assign(s,Ce._`typeof ${o}`).if(y1(t,o,i.strictNumbers),()=>n.assign(a,o)));n.if(Ce._`${a} !== undefined`);for(let u of r)if(VM.has(u)||u==="array"&&i.coerceTypes==="array")c(u);n.else(),b1(e),n.endIf(),n.if(Ce._`${a} !== undefined`,()=>{n.assign(o,a),qRe(e,a)});function c(u){switch(u){case"string":n.elseIf(Ce._`${s} == "number" || ${s} == "boolean"`).assign(a,Ce._`"" + ${o}`).elseIf(Ce._`${o} === null`).assign(a,Ce._`""`);return;case"number":n.elseIf(Ce._`${s} == "boolean" || ${o} === null
86
86
  || (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,Ce._`+${o}`);return;case"integer":n.elseIf(Ce._`${s} === "boolean" || ${o} === null
87
87
  || (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,Ce._`+${o}`);return;case"boolean":n.elseIf(Ce._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf(Ce._`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf(Ce._`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf(Ce._`${s} === "string" || ${s} === "number"
@@ -99,7 +99,7 @@ ${t}`,jSe,qSe,MSe=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=NSe.bind(nul
99
99
  `)}var mE=!1;var{spawn:FLe}=globalThis.Bun;async function C(e,t={}){let r={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let u of t.unsetEnv??[])delete r[u];let n=FLe({cmd:e,cwd:t.cwd,...t.stdin===void 0?{}:{stdin:new TextEncoder().encode(t.stdin)},stdout:"pipe",stderr:"pipe",env:r}),o=!1,i;if(t.timeout)i=setTimeout(()=>{o=!0,n.kill()},t.timeout);if(hE()){let u=t.cwd?` (cwd=${t.cwd})`:"";Tf(l.dim(`$ ${e.join(" ")}${u}`))}let s=await new Response(n.stdout).text(),a=await new Response(n.stderr).text(),c=await n.exited;if(i)clearTimeout(i);if(hE()){if(s.trim())Tf(l.dim(s.trimEnd()));if(a.trim())Tf(l.yellow(a.trimEnd()));Tf(l.dim(`(exit ${c})`))}if(o)return{stdout:s,stderr:a||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:c??1,timedOut:!0};return{stdout:s,stderr:a,exitCode:c,timedOut:!1}}var vt=O(()=>{Xe()});function ILe(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function dY(e,t=ILe()){return e.installInstructions[t]}function TLe(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function jLe(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:NLe}async function fY(e){try{let{exitCode:t,stdout:r,timedOut:n}=await C(e.cmd,{timeout:jLe()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:TLe(r)}}catch(t){let r=t instanceof Error?t.message:String(t);if(!r.includes("ENOENT")&&!r.includes("not found"))console.error(` Warning: ${e.name} check failed unexpectedly: ${r}`);return{available:!1}}}async function Nf(){let e=Object.entries(uY);return Promise.all(e.map(async([t,r])=>{let{available:n,version:o,timedOut:i}=await fY(r);return{key:t,name:r.name,purpose:r.purpose,required:r.required,available:n,version:o,timedOut:i,installInstruction:dY(r)}}))}async function pY(){let t=(await Nf()).filter((r)=>r.required&&!r.available);if(t.length===0)return[];console.warn(`
100
100
  Heads up: some tools NEMAR needs for uploading/validating aren't installed yet:`);for(let r of t)console.warn(` - ${r.name} (${r.purpose})`),console.warn(` Install: ${r.installInstruction}`);return console.warn("Run `nemar doctor` anytime to re-check. You can finish signup without them.\n"),t}async function Pa(e){let r=PLe[e].map((s)=>uY[s]).filter(Boolean),n=await Promise.all(r.map(async(s)=>{let a=await fY(s);return{check:s,available:a.available,timedOut:a.timedOut}}));for(let s of n)if(s.timedOut&&s.check.required)console.warn(`Warning: ${s.check.name} did not respond to a version check in time; continuing anyway.`);let o=n.filter((s)=>!s.available&&!s.timedOut&&s.check.required).map((s)=>({tool:s.check.name,installInstruction:dY(s.check)}));if(o.length===0)return;let i=[`
101
101
  Missing required tools:`];for(let s of o)i.push(` ${s.tool} not installed`),i.push(` Install: ${s.installInstruction}`);throw Error(i.join(`
102
- `))}var uY,PLe,NLe=4000;var jf=O(()=>{vt();uY={git:{name:"git",purpose:"version control for dataset metadata",cmd:["git","--version"],required:!0,installInstructions:{macos:"brew install git (or install Xcode Command Line Tools)",linux:"sudo apt-get install git OR sudo dnf install git",windows:"winget install Git.Git (or https://git-scm.com/download/win)"}},"git-annex":{name:"git-annex",purpose:"large-file data transfer (upload/download)",cmd:["git-annex","version"],required:!0,installInstructions:{macos:"brew install git-annex",linux:"sudo apt-get install git-annex OR sudo dnf install git-annex",windows:"Download the installer from https://git-annex.branchable.com/install/Windows/"}},gh:{name:"GitHub CLI (gh)",purpose:"GitHub authentication + repository operations",cmd:["gh","--version"],required:!0,installInstructions:{macos:"brew install gh",linux:"See https://cli.github.com/manual/installation",windows:"winget install GitHub.cli (or: scoop install gh)"}},aws:{name:"AWS CLI",purpose:"S3 data upload/download",cmd:["aws","--version"],required:!0,installInstructions:{macos:"brew install awscli",linux:"pip install awscli OR sudo snap install aws-cli --classic",windows:"winget install Amazon.AWSCLI (or the MSI from https://aws.amazon.com/cli/)"}},deno:{name:"Deno",purpose:"BIDS validation",cmd:["deno","--version"],required:!0,installInstructions:{macos:"brew install deno (or: curl -fsSL https://deno.land/install.sh | sh)",linux:"curl -fsSL https://deno.land/install.sh | sh",windows:"winget install DenoLand.Deno (or: irm https://deno.land/install.ps1 | iex)"}}},PLe={upload:["git-annex","gh","aws","deno"],download:["gh"],clone:["git","gh"],push:["git-annex","gh"],publish:["gh","aws"],update:["git","gh"],release:["git","gh"]}});var hY;var mY=O(()=>{hY={name:"nemar-cli",version:"0.10.11-dev.3005",description:"CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",type:"module",main:"dist/index.js",bin:{nemar:"dist/index.js"},scripts:{dev:"bun run src/index.ts",build:"bun build src/index.ts --outdir dist --target bun --minify && sed '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js",test:"bun test",lint:"biome check src/","migrations:d1-check":"bun run scripts/d1-migration-check.ts","zarr:geometry-check":"bun run backend/scripts/zarr-geometry-conformance.ts","lint:fix":"biome check --fix src/",format:"biome format --write src/",typecheck:"tsc --noEmit && tsc --noEmit -p backend","generate-openapi":"bun run scripts/generate-openapi.ts",prepublishOnly:"bun run build",prepare:"husky",postinstall:"bun scripts/postinstall-check.mjs",deploy:"wrangler deploy",preview:"wrangler dev"},keywords:["nemar","bids","neuroimaging","eeg","emg","datalad","cli"],author:"NEMAR Team",license:"CC-BY-NC-ND-4.0",repository:{type:"git",url:"git+https://github.com/nemarOrg/nemar-cli.git"},bugs:{url:"https://github.com/nemarOrg/nemar-cli/issues"},homepage:"https://docs.nemar.org",engines:{bun:">=1.0.0"},files:["dist","scripts/postinstall-check.mjs","scripts/recover-datasets.json","scripts/withdrawn-datasets.json","README.md","LICENSE"],dependencies:{chalk:"^5.3.0",commander:"^12.1.0",conf:"^13.0.1",inquirer:"^9.2.15",ora:"^8.0.1",semver:"^7.8.5",zod:"^3.23.8"},"lint-staged":{"src/**/*.{ts,tsx}":["biome check --fix"],"backend/src/**/*.{ts,tsx}":["biome check --fix"]},devDependencies:{"@asteasolutions/zod-to-openapi":"^7.3.4","@biomejs/biome":"1.9.4","@types/bun":"latest","@types/inquirer":"^9.0.7","@types/semver":"^7.8.0",ajv:"^8.20.0","ajv-formats":"^3.0.1",bcryptjs:"^3.0.3",husky:"^9.1.7","lint-staged":"^16.3.2",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var Si;var qf=O(()=>{mY();Si=hY.version});import{mkdirSync as MLe,readdirSync as LLe,unlinkSync as BLe,writeFileSync as ULe}from"fs";import{join as gE}from"path";function vY(){Fl=!0}function Ia(){return Fl}function wY(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function Lf(e){_Y=e,$r(`Step: ${e}`)}function Bf(){bY=!0}function DY(){return bY}function bE(){xY=!0}function EY(){return xY}function $r(e){if(Fl)process.stderr.write(`[debug] ${e}
102
+ `))}var uY,PLe,NLe=4000;var jf=O(()=>{vt();uY={git:{name:"git",purpose:"version control for dataset metadata",cmd:["git","--version"],required:!0,installInstructions:{macos:"brew install git (or install Xcode Command Line Tools)",linux:"sudo apt-get install git OR sudo dnf install git",windows:"winget install Git.Git (or https://git-scm.com/download/win)"}},"git-annex":{name:"git-annex",purpose:"large-file data transfer (upload/download)",cmd:["git-annex","version"],required:!0,installInstructions:{macos:"brew install git-annex",linux:"sudo apt-get install git-annex OR sudo dnf install git-annex",windows:"Download the installer from https://git-annex.branchable.com/install/Windows/"}},gh:{name:"GitHub CLI (gh)",purpose:"GitHub authentication + repository operations",cmd:["gh","--version"],required:!0,installInstructions:{macos:"brew install gh",linux:"See https://cli.github.com/manual/installation",windows:"winget install GitHub.cli (or: scoop install gh)"}},aws:{name:"AWS CLI",purpose:"S3 data upload/download",cmd:["aws","--version"],required:!0,installInstructions:{macos:"brew install awscli",linux:"pip install awscli OR sudo snap install aws-cli --classic",windows:"winget install Amazon.AWSCLI (or the MSI from https://aws.amazon.com/cli/)"}},deno:{name:"Deno",purpose:"BIDS validation",cmd:["deno","--version"],required:!0,installInstructions:{macos:"brew install deno (or: curl -fsSL https://deno.land/install.sh | sh)",linux:"curl -fsSL https://deno.land/install.sh | sh",windows:"winget install DenoLand.Deno (or: irm https://deno.land/install.ps1 | iex)"}}},PLe={upload:["git-annex","gh","aws","deno"],download:["gh"],clone:["git","gh"],push:["git-annex","gh"],publish:["gh","aws"],update:["git","gh"],release:["git","gh"]}});var hY;var mY=O(()=>{hY={name:"nemar-cli",version:"0.10.11-dev.3009",description:"CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",type:"module",main:"dist/index.js",bin:{nemar:"dist/index.js"},scripts:{dev:"bun run src/index.ts",build:"bun build src/index.ts --outdir dist --target bun --minify && sed '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js",test:"bun test",lint:"biome check src/","migrations:d1-check":"bun run scripts/d1-migration-check.ts","zarr:geometry-check":"bun run backend/scripts/zarr-geometry-conformance.ts","lint:fix":"biome check --fix src/",format:"biome format --write src/",typecheck:"tsc --noEmit && tsc --noEmit -p backend","generate-openapi":"bun run scripts/generate-openapi.ts",prepublishOnly:"bun run build",prepare:"husky",postinstall:"bun scripts/postinstall-check.mjs",deploy:"wrangler deploy",preview:"wrangler dev"},keywords:["nemar","bids","neuroimaging","eeg","emg","datalad","cli"],author:"NEMAR Team",license:"CC-BY-NC-ND-4.0",repository:{type:"git",url:"git+https://github.com/nemarOrg/nemar-cli.git"},bugs:{url:"https://github.com/nemarOrg/nemar-cli/issues"},homepage:"https://docs.nemar.org",engines:{bun:">=1.0.0"},files:["dist","scripts/postinstall-check.mjs","scripts/recover-datasets.json","scripts/withdrawn-datasets.json","README.md","LICENSE"],dependencies:{chalk:"^5.3.0",commander:"^12.1.0",conf:"^13.0.1",inquirer:"^9.2.15",ora:"^8.0.1",semver:"^7.8.5",zod:"^3.23.8"},"lint-staged":{"src/**/*.{ts,tsx}":["biome check --fix"],"backend/src/**/*.{ts,tsx}":["biome check --fix"]},devDependencies:{"@asteasolutions/zod-to-openapi":"^7.3.4","@biomejs/biome":"1.9.4","@types/bun":"latest","@types/inquirer":"^9.0.7","@types/semver":"^7.8.0",ajv:"^8.20.0","ajv-formats":"^3.0.1",bcryptjs:"^3.0.3",husky:"^9.1.7","lint-staged":"^16.3.2",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var Si;var qf=O(()=>{mY();Si=hY.version});import{mkdirSync as MLe,readdirSync as LLe,unlinkSync as BLe,writeFileSync as ULe}from"fs";import{join as gE}from"path";function vY(){Fl=!0}function Ia(){return Fl}function wY(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function Lf(e){_Y=e,$r(`Step: ${e}`)}function Bf(){bY=!0}function DY(){return bY}function bE(){xY=!0}function EY(){return xY}function $r(e){if(Fl)process.stderr.write(`[debug] ${e}
103
103
  `)}function HLe(e){let t={};for(let[r,n]of Object.entries(e))t[r]=GLe.has(r.toLowerCase())?"[REDACTED]":n;return t}function $Y(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function yE(e,t,r=0){if(r>KLe)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((n)=>yE(e,n,r+1));if(t&&typeof t==="object"){let n={};for(let[o,i]of Object.entries(t))n[o]=yE(o,i,r+1);return n}if(typeof t==="string"){if(WLe.test(e))return"[REDACTED]";return t.replace(SY,$Y)}return t}function xE(e){return e.replace(YLe,"Bearer [REDACTED]").replace(JLe,"[REDACTED_AWS_KEY]").replace(XLe,"$1[REDACTED]").replace(ZLe,"$1$2=[REDACTED]").replace(SY,$Y)}function QLe(e){return xE(e)}function gY(e,t=VLe){if(e===void 0)return;let r=e;try{let n=JSON.parse(e);r=JSON.stringify(yE("",n))}catch{}if(r=xE(r),Buffer.byteLength(r,"utf8")>t)r=`${Buffer.from(r,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return r}function I0(e){if(!Fl)return;let t=QLe(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?HLe(e.requestHeaders):void 0,requestBody:gY(e.requestBody),responseBody:gY(e.responseBody)};P0.push(r),$r(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=N(r);P0.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${n}`}),$r(`redaction failed for ${e.method} ${t}: ${n}`)}}async function eBe(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${Si}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${N(t)})`)}e.push(""),e.push("Active account:");try{let t=ot();if(t.apiKey){if(t.username)e.push(` Username: ${t.username}`);if(e.push(` API URL: ${t.apiUrl}`),t.role)e.push(` Role: ${t.role}`);e.push(` Sandbox completed: ${!!t.sandboxCompleted}`)}else e.push(" (not authenticated)")}catch(t){e.push(` (could not read account config: ${N(t)})`)}e.push(""),e.push("External tools:");try{let t=await Nf();for(let r of t){let n=r.available?r.version??"installed":r.timedOut?"(timed out)":"not installed";e.push(` ${r.name}: ${n}`)}}catch(t){e.push(` (could not probe external tools: ${N(t)})`)}return e}async function _E(){return(await eBe()).join(`
104
104
  `)}async function CY(){if(!Fl||F0!==void 0)return;try{F0=await _E()}catch(e){let t=N(e);F0=`(could not build environment report: ${t})`,$r(`environment snapshot failed: ${t}`)}}function kY(e){if(yY.has(e))return{flag:e};for(let t of yY){if(!e.startsWith(t)||e.length<=t.length)continue;if(t.length===2)return{flag:t,kind:"short-attached"};if(e[t.length]==="=")return{flag:t,kind:"long-eq"}}return null}function tBe(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],o=kY(n);if(!o){t.push(n);continue}if(o.kind==="long-eq")t.push(`${o.flag}=[REDACTED]`);else if(o.kind==="short-attached")t.push(`${o.flag}[REDACTED]`);else if(t.push(n),r+1<e.length)t.push("[REDACTED]"),r++}return t}function rBe(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],o=kY(n);if(!o){t.push(n);continue}if(!o.kind&&r+1<e.length)r++}return t}function nBe(e){let t=[];for(let n of rBe(e)){if(n.startsWith("-"))continue;if(t.push(n),t.length===2)break}return(t.length>0?t.join("-"):"nemar").replace(/[^a-zA-Z0-9_-]/g,"_")}function oBe(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${xE(tBe(e).join(" "))}`),r.push(""),r.push(F0??"(environment snapshot unavailable)"),r.push(""),r.push("HTTP requests:"),P0.length===0)r.push(" (none)");else P0.forEach((n,o)=>{if(r.push(` [${o+1}] ${n.method} ${n.url} -> ${n.status??"ERROR"} (${n.durationMs}ms)`),n.error)r.push(` Error: ${n.error}`);if(n.note)r.push(` Note: ${n.note}`);if(n.requestHeaders)r.push(` Request headers: ${JSON.stringify(n.requestHeaders)}`);if(n.requestBody)r.push(` Request body: ${n.requestBody}`);if(n.responseBody)r.push(` Response body: ${n.responseBody}`)});return r.push(""),r.push(`Failing step: ${_Y??"(none recorded)"}`),r.push(`Exit code: ${t}`),`${r.join(`
105
105
  `)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nemar-cli",
3
- "version": "0.10.11-dev.3005",
3
+ "version": "0.10.11-dev.3009",
4
4
  "description": "CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",