jsrepo 3.7.1 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/config.d.mts +1 -1
- package/dist/api/config.mjs +1 -1
- package/dist/api/errors.d.mts +1 -1
- package/dist/api/errors.mjs +1 -1
- package/dist/api/index.d.mts +1 -1
- package/dist/api/index.mjs +1 -1
- package/dist/api/langs/index.d.mts +1 -1
- package/dist/api/langs/index.mjs +1 -1
- package/dist/api/langs/js.d.mts +1 -1
- package/dist/api/langs/js.mjs +1 -1
- package/dist/api/outputs.d.mts +1 -1
- package/dist/api/outputs.mjs +1 -1
- package/dist/api/providers.d.mts +1 -1
- package/dist/api/providers.mjs +1 -1
- package/dist/api/utils.d.mts +1 -1
- package/dist/api/utils.mjs +1 -1
- package/dist/api/warnings.d.mts +1 -1
- package/dist/bin.mjs +15 -13
- package/dist/{config-DNuHb7Tn.d.mts → config-DzI6aP1q.d.mts} +48 -17
- package/dist/errors-ZO96VU6k.mjs +2 -0
- package/dist/{providers-DIGyIdpX.mjs → providers-Dc3L9h_M.mjs} +2 -2
- package/package.json +1 -1
- package/dist/errors-C7KsbF1p.mjs +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,n as t,r as n,t as r}from"./picocolors-DQPB0Sb5.mjs";import{_ as i,b as a,c as o,f as s,g as c,h as l,i as u,m as d,n as f,o as p,p as m,r as h,t as g,u as _}from"./warnings-DFbHh8ba.mjs";import{B as v,C as y,D as b,E as x,F as S,H as C,I as w,L as ee,M as T,R as E,S as D,T as O,V as k,c as te,d as ne,f as re,k as ie,l as ae,m as oe,n as A,o as se,p as ce,r as le,s as j,u as M,v as ue,w as de,y as fe,z as pe}from"./errors-C7KsbF1p.mjs";import me,{builtinModules as he,createRequire as ge}from"node:module";import N,{cwd as _e}from"node:process";import P from"node:readline";import F from"node:fs";import I,{delimiter as ve,dirname as ye,normalize as be,resolve as xe}from"node:path";import{isDeepStrictEqual as Se,promisify as Ce,stripVTControlCharacters as we}from"node:util";import{parse as Te}from"oxc-parser";import Ee from"node:fs/promises";import De from"node:os";import{createRequire as Oe}from"module";import{spawn as ke}from"node:child_process";import{PassThrough as Ae}from"node:stream";import je from"fs";import Me from"os";import Ne from"path";import{createConfigLoader as Pe}from"unconfig";import Fe from"node:crypto";import Ie from"node:assert";var Le=`jsrepo`,Re=`A CLI to add shared code from remote repositories.`,ze=`3.7.1`,Be=t((e=>{let t={withStackTrace:!1},n=(e,n,r=t)=>({data:n.isOk()?{type:`Ok`,value:n.value}:{type:`Err`,value:n.error},message:e,stack:r.withStackTrace?Error().stack:void 0});function r(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function i(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function a(e){return this instanceof a?(this.v=e,this):new a(e)}function o(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),c(`next`),c(`throw`),c(`return`,s),i[Symbol.asyncIterator]=function(){return this},i;function s(e){return function(t){return Promise.resolve(t).then(e,f)}}function c(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||l(e,t)})},t&&(i[e]=t(i[e])))}function l(e,t){try{u(r[e](t))}catch(e){p(o[0][3],e)}}function u(e){e.value instanceof a?Promise.resolve(e.value.v).then(d,f):p(o[0][2],e)}function d(e){l(`next`,e)}function f(e){l(`throw`,e)}function p(e,t){e(t),o.shift(),o.length&&l(o[0][0],o[0][1])}}function s(e){var t,n;return t={},r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:a(e[r](t)),done:!1}:i?i(t):t}:i}}function c(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof i==`function`?i(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,i){n=e[t](n),a(r,i,n.done,n.value)})}}function a(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}var l=class e{constructor(e){this._promise=e}static fromSafePromise(t){return new e(t.then(e=>new S(e)))}static fromPromise(t,n,r){return new e(t.then(e=>new S(e)).catch(e=>new C(n(e))).finally(r))}static fromThrowable(t,n,i){return(...a)=>new e(r(this,void 0,void 0,function*(){try{return new S(yield t(...a))}catch(e){return new C(n?n(e):e)}finally{i?.()}}))}static combine(e){return g(e)}static combineWithAllErrors(e){return v(e)}map(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){return e.isErr()?new C(e.error):new S(yield t(e.value))})))}andThrough(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){if(e.isErr())return new C(e.error);let n=yield t(e.value);return n.isErr()?new C(n.error):new S(e.value)})))}andTee(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){if(e.isErr())return new C(e.error);try{yield t(e.value)}catch{}return new S(e.value)})))}orTee(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){if(e.isOk())return new S(e.value);try{yield t(e.error)}catch{}return new C(e.error)})))}mapErr(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){return e.isOk()?new S(e.value):new C(yield t(e.error))})))}andThen(t){return new e(this._promise.then(n=>{if(n.isErr())return new C(n.error);let r=t(n.value);return r instanceof e?r._promise:r}))}finally(t){return new e(this._promise.finally(t))}orElse(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){return e.isErr()?t(e.error):new S(e.value)})))}match(e,t){return r(this,void 0,void 0,function*(){return this._promise.then(n=>n.match(e,t))})}unwrapOr(e){return r(this,void 0,void 0,function*(){return this._promise.then(t=>t.unwrapOr(e))})}safeUnwrap(){return o(this,arguments,function*(){return yield a(yield a(yield*s(c(yield a(this._promise.then(e=>e.safeUnwrap()))))))})}then(e,t){return this._promise.then(e,t)}[Symbol.asyncIterator](){return o(this,arguments,function*(){let e=yield a(this._promise);return e.isErr()&&(yield yield a(d(e.error))),yield a(e.value)})}};function u(e){return new l(Promise.resolve(new S(e)))}function d(e){return new l(Promise.resolve(new C(e)))}let f=l.fromPromise,p=l.fromSafePromise,m=l.fromThrowable,h=e=>{let t=y([]);for(let n of e)if(n.isErr()){t=b(n.error);break}else t.map(e=>e.push(n.value));return t},g=e=>l.fromSafePromise(Promise.all(e)).andThen(h),_=e=>{let t=y([]);for(let n of e)n.isErr()&&t.isErr()?t.error.push(n.error):n.isErr()&&t.isOk()?t=b([n.error]):n.isOk()&&t.isOk()&&t.value.push(n.value);return t},v=e=>l.fromSafePromise(Promise.all(e)).andThen(_);e.ResultJson=void 0,(function(e){function t(e){return!!(typeof e==`object`&&e&&`__tag`in e&&(`error`in e||`value`in e))}e.is=t;function n(e){return e.__tag===`err`}e.isErr=n;function r(e){return e.__tag===`ok`}e.isOk=r;function i(e){return{__tag:`ok`,value:e}}e.ok=i;function a(e){return{__tag:`err`,error:e}}e.err=a})(e.ResultJson||={}),e.Result=void 0,(function(t){function n(e,t){return(...n)=>{try{return y(e(...n))}catch(e){return b(t?t(e):e)}}}t.fromThrowable=n;function r(e){return h(e)}t.combine=r;function i(e){return _(e)}t.combineWithAllErrors=i;function a(t){return e.ResultJson.isOk(t)?y(t.value):b(t.error)}t.fromJson=a})(e.Result||={});function y(e){return new S(e)}function b(e){return new C(e)}function x(e){let t=e().next();return t instanceof Promise?new l(t.then(e=>e.value)):t.value}var S=class{constructor(e){this.value=e,this.__tag=`ok`}toJson(){return{__tag:this.__tag,value:this.value}}isOk(){return!0}isErr(){return!this.isOk()}map(e){return y(e(this.value))}mapErr(e){return y(this.value)}andThen(e){return e(this.value)}andThrough(e){return e(this.value).map(e=>this.value)}andTee(e){try{e(this.value)}catch{}return y(this.value)}orTee(e){return y(this.value)}orElse(e){return y(this.value)}asyncAndThen(e){return e(this.value)}asyncAndThrough(e){return e(this.value).map(()=>this.value)}asyncMap(e){return l.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,t){return e(this.value)}expect(){return this.value}expectErr(e){throw e instanceof Error?e:n(e,this)}safeUnwrap(){let e=this.value;return(function*(){return e})()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw n("Called `_unsafeUnwrapErr` on an Ok",this,e)}*[Symbol.iterator](){return this.value}},C=class{constructor(e){this.error=e,this.__tag=`err`}toJson(){return{__tag:this.__tag,error:this.error}}isOk(){return!1}isErr(){return!this.isOk()}map(e){return b(this.error)}mapErr(e){return b(e(this.error))}andThrough(e){return b(this.error)}andTee(e){return b(this.error)}orTee(e){try{e(this.error)}catch{}return b(this.error)}andThen(e){return b(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return d(this.error)}asyncAndThrough(e){return d(this.error)}asyncMap(e){return d(this.error)}unwrapOr(e){return e}match(e,t){return t(this.error)}expect(e){throw e instanceof Error?e:n(e,this)}expectErr(){return this.error}safeUnwrap(){let e=this.error;return(function*(){throw yield b(e),Error("Do not use this generator out of `safeTry`")})()}_unsafeUnwrap(e){throw n("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}*[Symbol.iterator](){return yield this,this}};let w=e.Result.fromThrowable;e.Err=C,e.Ok=S,e.ResultAsync=l,e.err=b,e.errAsync=d,e.fromAsyncThrowable=m,e.fromPromise=f,e.fromSafePromise=p,e.fromThrowable=w,e.ok=y,e.okAsync=u,e.safeTry=x}));let Ve=()=>{var e=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},a=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(let c of n(a))!r.call(i,c)&&c!==o&&e(i,c,{get:()=>a[c],enumerable:!(s=t(a,c))||s.enumerable});return i},o=t=>a(e({},`__esModule`,{value:!0}),t),s={};i(s,{default:()=>Pe});var c=e=>Array.isArray(e),l=e=>typeof e==`function`,u=e=>e.length===0,d=e=>typeof e==`number`,f=e=>typeof e==`object`&&!!e,p=e=>e instanceof RegExp,m=e=>typeof e==`string`,h=e=>e===void 0,g=e=>{let t=new Map;return n=>{let r=t.get(n);if(r)return r;let i=e(n);return t.set(n,i),i}},_=(e,t,n={})=>{let r={cache:{},input:e,index:0,indexMax:0,options:n,output:[]};if(te(t)(r)&&r.index===e.length)return r.output;throw Error(`Failed to parse at index ${r.indexMax}`)},v=(e,t)=>c(e)?y(e,t):m(e)?x(e,t):b(e,t),y=(e,t)=>{let n={};for(let t of e){if(t.length!==1)throw Error(`Invalid character: "${t}"`);let e=t.charCodeAt(0);n[e]=!0}return e=>{let r=e.index,i=e.input;for(;e.index<i.length&&i.charCodeAt(e.index)in n;)e.index+=1;let a=e.index;if(a>r){if(!h(t)&&!e.options.silent){let n=e.input.slice(r,a),o=l(t)?t(n,i,String(r)):t;h(o)||e.output.push(o)}e.indexMax=Math.max(e.indexMax,e.index)}return!0}},b=(e,t)=>{let n=e.source,r=e.flags.replace(/y|$/,`y`),i=new RegExp(n,r);return O(e=>{i.lastIndex=e.index;let n=i.exec(e.input);if(n){if(!h(t)&&!e.options.silent){let r=l(t)?t(...n,e.input,String(e.index)):t;h(r)||e.output.push(r)}return e.index+=n[0].length,e.indexMax=Math.max(e.indexMax,e.index),!0}else return!1})},x=(e,t)=>n=>{if(n.input.startsWith(e,n.index)){if(!h(t)&&!n.options.silent){let r=l(t)?t(e,n.input,String(n.index)):t;h(r)||n.output.push(r)}return n.index+=e.length,n.indexMax=Math.max(n.indexMax,n.index),!0}else return!1},S=(e,t,n,r)=>{let i=te(e);return O(D(E(e=>{let r=0;for(;r<n;){let t=e.index;if(!i(e)||(r+=1,e.index===t))break}return r>=t})))},C=(e,t)=>S(e,0,1),w=(e,t)=>S(e,0,1/0),ee=(e,t)=>{let n=e.map(te);return O(D(E(e=>{for(let t=0,r=n.length;t<r;t++)if(!n[t](e))return!1;return!0})))},T=(e,t)=>{let n=e.map(te);return O(D(e=>{for(let t=0,r=n.length;t<r;t++)if(n[t](e))return!0;return!1}))},E=(e,t=!1)=>{let n=te(e);return e=>{let r=e.index,i=e.output.length,a=n(e);return(!a||t)&&(e.index=r,e.output.length!==i&&(e.output.length=i)),a}},D=(e,t)=>te(e),O=(()=>{let e=0;return t=>{let n=te(t),r=e+=1;return e=>{var t;if(e.options.memoization===!1)return n(e);let i=e.index,a=(t=e.cache)[r]||(t[r]=new Map),o=a.get(i);if(o===!1)return!1;if(d(o))return e.index=o,!0;if(o)return e.index=o.index,o.output?.length&&e.output.push(...o.output),!0;{let t=e.output.length;if(n(e)){let n=e.index,r=e.output.length;if(r>t){let o=e.output.slice(t,r);a.set(i,{index:n,output:o})}else a.set(i,n);return!0}else return a.set(i,!1),!1}}}})(),k=e=>{let t;return n=>(t||=te(e()),t(n))},te=g(e=>{if(l(e))return u(e)?k(e):e;if(m(e)||p(e))return v(e);if(c(e))return ee(e);if(f(e))return T(Object.values(e));throw Error(`Invalid rule`)}),ne=`abcdefghijklmnopqrstuvwxyz`,re=e=>{let t=``;for(;e>0;)t=ne[(e-1)%26]+t,e=Math.floor((e-1)/26);return t},ie=e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t=t*26+ne.indexOf(e[n])+1;return t},ae=(e,t)=>{if(t<e)return ae(t,e);let n=[];for(;e<=t;)n.push(e++);return n},oe=(e,t,n)=>ae(e,t).map(e=>String(e).padStart(n,`0`)),A=(e,t)=>ae(ie(e),ie(t)).map(re),se=e=>e,ce=e=>le(t=>_(t,e,{memoization:!1}).join(``)),le=e=>{let t={};return n=>t[n]??(t[n]=e(n))},j=v(/^\*\*\/\*$/,`.*`),M=v(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/,(e,t,n)=>`.*${t?``:`(?:^|/)`}${n.replaceAll(`.`,`\\.`)}`),ue=v(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/,(e,t,n,r)=>`.*${t?``:`(?:^|/)`}${n.replaceAll(`.`,`\\.`)}(?:${r.replaceAll(`,`,`|`).replaceAll(`.`,`\\.`)})`),de=v(/\\./,se),fe=v(/[$.*+?^(){}[\]\|]/,e=>`\\${e}`),pe=v(/./,se),me=T([v(/^(?:!!)*!(.*)$/,(e,t)=>`(?!^${ke(t)}$).*?`),v(/^(!!)+/,``)]),he=T([v(/\/(\*\*\/)+/,`(?:/.+/|/)`),v(/^(\*\*\/)+/,`(?:^|.*/)`),v(/\/(\*\*)$/,`(?:/.*|$)`),v(/\*\*/,`.*`)]),ge=T([v(/\*\/(?!\*\*\/)/,`[^/]*/`),v(/\*/,`[^/]*`)]),N=v(`?`,`[^/]`),_e=v(`[`,se),P=v(`]`,se),F=v(/[!^]/,`^/`),I=v(/[a-z]-[a-z]|[0-9]-[0-9]/i,se),ve=T([de,v(/[$.*+?^(){}[\|]/,e=>`\\${e}`),I,v(/[^\]]/,se)]),ye=ee([_e,C(F),w(ve),P]),be=v(`{`,`(?:`),xe=v(`}`,`)`),Se=ee([be,T([v(/(\d+)\.\.(\d+)/,(e,t,n)=>oe(+t,+n,Math.min(t.length,n.length)).join(`|`)),v(/([a-z]+)\.\.([a-z]+)/,(e,t,n)=>A(t,n).join(`|`)),v(/([A-Z]+)\.\.([A-Z]+)/,(e,t,n)=>A(t.toLowerCase(),n.toLowerCase()).join(`|`).toUpperCase())]),xe]),Ce=v(`{`,`(?:`),we=v(`}`,`)`),Te=v(`,`,`|`),Ee=v(/[$.*+?^(){[\]\|]/,e=>`\\${e}`),De=v(/[^}]/,se),Oe=ee([Ce,w(T([he,ge,N,ye,Se,k(()=>Oe),de,Ee,Te,De])),we]),ke=ce(w(T([j,M,ue,me,he,ge,N,ye,Se,Oe,de,fe,pe]))),Ae=v(/\\./,se),je=v(/./,se),Me=ce(w(T([Ae,v(/\*\*\*+/,`*`),v(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),v(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),je]))),Ne=(e,t)=>{let n=Array.isArray(e)?e:[e];if(!n.length)return!1;let r=n.map(Ne.compile),i=n.every(e=>/(\/(?:\*\*)?|\[\/\])$/.test(e)),a=t.replace(/[\\\/]+/g,`/`).replace(/\/$/,i?`/`:``);return r.some(e=>e.test(a))};Ne.compile=e=>RegExp(`^${ke(Me(e))}$`,`s`);var Pe=Ne;return o(s)})();return e.default||e},He;const Ue=(e,t)=>(He||(He=Ve(),Ve=null),He(e,t)),We=/^[A-Za-z]:\//;function Ge(e=``){return e&&e.replace(/\\/g,`/`).replace(We,e=>e.toUpperCase())}const Ke=/^[/\\]{2}/,qe=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Je=/^[A-Za-z]:$/,Ye=/^\/([A-Za-z]:)?$/,Xe=/.(\.[^./]+|\.)$/,Ze=/^[/\\]|^[a-zA-Z]:[/\\]/,Qe=function(e){if(e.length===0)return`.`;e=Ge(e);let t=e.match(Ke),n=rt(e),r=e[e.length-1]===`/`;return e=nt(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),Je.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!rt(e)?`/${e}`:e)},$e=function(...e){let t=``;for(let n of e)if(n)if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;e&&r?t+=n.slice(1):t+=e||r?n:`/${n}`}else t+=n;return Qe(t)};function et(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const tt=function(...e){e=e.map(e=>Ge(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:et();!i||i.length===0||(t=`${i}/${t}`,n=rt(i))}return t=nt(t,!n),n&&!rt(t)?`/${t}`:t.length>0?t:`.`};function nt(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}const rt=function(e){return qe.test(e)},it=function(e){return Ge(e)},at=function(e){if(e===`..`)return``;let t=Xe.exec(Ge(e));return t&&t[1]||``},ot=function(e,t){let n=tt(e).replace(Ye,`$1`).split(`/`),r=tt(t).replace(Ye,`$1`).split(`/`);if(r[0][1]===`:`&&n[0][1]===`:`&&n[0]!==r[0])return r.join(`/`);let i=[...n];for(let e of i){if(r[0]!==e)break;n.shift(),r.shift()}return[...n.map(()=>`..`),...r].join(`/`)},st=function(e){let t=Ge(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&Je.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(rt(e)?`/`:`.`)},ct=function(e){let t=e.ext?e.ext.startsWith(`.`)?e.ext:`.${e.ext}`:``,n=[e.root,e.dir,e.base??(e.name??``)+t].filter(Boolean);return Ge(e.root?tt(...n):n.join(`/`))},lt=function(e,t){let n=Ge(e).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return t&&r.endsWith(t)?r.slice(0,-t.length):r},ut={__proto__:null,basename:lt,dirname:st,extname:at,format:ct,isAbsolute:rt,join:$e,matchesGlob:(e,t)=>Ue(t,Qe(e)),normalize:Qe,normalizeString:nt,parse:function(e){let t=Ze.exec(e)?.[0]?.replace(/\\/g,`/`)||``,n=lt(e),r=at(n);return{root:t,dir:st(e),base:n,ext:r,name:n.slice(0,n.length-r.length)}},relative:ot,resolve:tt,sep:`/`,toNamespacedPath:it},dt=globalThis.process?.platform===`win32`?`;`:`:`,ft={posix:void 0,win32:void 0},pt=(e=dt)=>new Proxy(ut,{get(t,n){return n===`delimiter`?e:n===`posix`?L:n===`win32`?mt:ft[n]||ut[n]}}),L=pt(`:`),mt=pt(`;`);Object.freeze({status:`aborted`});function R(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var ht=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},gt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};const _t={};function vt(e){return e&&Object.assign(_t,e),_t}function yt(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function bt(e,t){return typeof t==`bigint`?t.toString():t}function xt(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function St(e){return e==null}function Ct(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function wt(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}const Tt=Symbol(`evaluating`);function Et(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Tt)return r===void 0&&(r=Tt,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Dt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ot(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function kt(e){return JSON.stringify(e)}function At(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const jt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Mt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Nt=xt(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Pt(e){if(Mt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Mt(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Ft(e){return Pt(e)?{...e}:Array.isArray(e)?[...e]:e}const It=new Set([`string`,`number`,`symbol`]);function Lt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Rt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function z(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function zt(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const Bt={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Vt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Rt(e,Ot(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Dt(this,`shape`,e),e},checks:[]}))}function Ht(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Rt(e,Ot(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Dt(this,`shape`,r),r},checks:[]}))}function Ut(e,t){if(!Pt(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Rt(e,Ot(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Dt(this,`shape`,n),n}}))}function Wt(e,t){if(!Pt(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Rt(e,Ot(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Dt(this,`shape`,n),n}}))}function Gt(e,t){return Rt(e,Ot(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Dt(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Kt(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Rt(t,Ot(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Dt(this,`shape`,i),i},checks:[]}))}function qt(e,t,n){return Rt(t,Ot(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Dt(this,`shape`,i),i}}))}function Jt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Yt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Xt(e){return typeof e==`string`?e:e?.message}function Zt(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Xt(e.inst?._zod.def?.error?.(e))??Xt(t?.error?.(e))??Xt(n.customError?.(e))??Xt(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Qt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function $t(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const en=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,bt,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},tn=R(`$ZodError`,en),nn=R(`$ZodError`,en,{Parent:Error});function rn(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function an(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}const on=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new ht;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Zt(e,a,vt())));throw jt(t,i?.callee),t}return o.value},sn=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Zt(e,a,vt())));throw jt(t,i?.callee),t}return o.value},cn=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ht;return a.issues.length?{success:!1,error:new(e??tn)(a.issues.map(e=>Zt(e,i,vt())))}:{success:!0,data:a.value}},ln=cn(nn),un=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Zt(e,i,vt())))}:{success:!0,data:a.value}},dn=un(nn),fn=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return on(e)(t,n,i)},pn=e=>(t,n,r)=>on(e)(t,n,r),mn=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return sn(e)(t,n,i)},hn=e=>async(t,n,r)=>sn(e)(t,n,r),gn=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return cn(e)(t,n,i)},_n=e=>(t,n,r)=>cn(e)(t,n,r),vn=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return un(e)(t,n,i)},yn=e=>async(t,n,r)=>un(e)(t,n,r),bn=/^[cC][^\s-]{8,}$/,xn=/^[0-9a-z]+$/,Sn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Cn=/^[0-9a-vA-V]{20}$/,wn=/^[A-Za-z0-9]{27}$/,Tn=/^[a-zA-Z0-9_-]{21}$/,En=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Dn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,On=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,kn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function An(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const jn=/^(?:(?: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])$/,Mn=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,Nn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Pn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,In=/^[A-Za-z0-9_-]*$/,Ln=/^\+[1-9]\d{6,14}$/,Rn=`(?:(?:\\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])))`,zn=RegExp(`^${Rn}$`);function Bn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Vn(e){return RegExp(`^${Bn(e)}$`)}function Hn(e){let t=Bn({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Rn}T(?:${r})$`)}const Un=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Wn=/^-?\d+$/,Gn=/^-?\d+(?:\.\d+)?$/,Kn=/^(?:true|false)$/i,qn=/^undefined$/i,Jn=/^[^A-Z]*$/,Yn=/^[^a-z]*$/,Xn=R(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Zn={number:`number`,bigint:`bigint`,object:`date`},Qn=R(`$ZodCheckLessThan`,(e,t)=>{Xn.init(e,t);let n=Zn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$n=R(`$ZodCheckGreaterThan`,(e,t)=>{Xn.init(e,t);let n=Zn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),er=R(`$ZodCheckMultipleOf`,(e,t)=>{Xn.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):wt(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),tr=R(`$ZodCheckNumberFormat`,(e,t)=>{Xn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Bt[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Wn)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),nr=R(`$ZodCheckMaxLength`,(e,t)=>{var n;Xn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!St(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Qt(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rr=R(`$ZodCheckMinLength`,(e,t)=>{var n;Xn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!St(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Qt(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ir=R(`$ZodCheckLengthEquals`,(e,t)=>{var n;Xn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!St(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Qt(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ar=R(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Xn.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),or=R(`$ZodCheckRegex`,(e,t)=>{ar.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),sr=R(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Jn,ar.init(e,t)}),cr=R(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Yn,ar.init(e,t)}),lr=R(`$ZodCheckIncludes`,(e,t)=>{Xn.init(e,t);let n=Lt(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ur=R(`$ZodCheckStartsWith`,(e,t)=>{Xn.init(e,t);let n=RegExp(`^${Lt(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),dr=R(`$ZodCheckEndsWith`,(e,t)=>{Xn.init(e,t);let n=RegExp(`.*${Lt(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),fr=R(`$ZodCheckOverwrite`,(e,t)=>{Xn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var pr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./picocolors-DQPB0Sb5.mjs";import{_ as i,b as a,c as o,f as s,g as c,h as l,i as u,m as d,n as f,o as p,p as m,r as h,t as g,u as _}from"./warnings-DFbHh8ba.mjs";import{B as v,C as y,D as b,E as x,F as S,H as C,I as w,L as ee,M as T,R as E,S as D,T as O,V as k,c as te,d as ne,f as re,k as ie,l as ae,m as oe,n as A,o as se,p as ce,r as le,s as j,u as M,v as ue,w as de,y as fe,z as pe}from"./errors-ZO96VU6k.mjs";import me,{builtinModules as he,createRequire as ge}from"node:module";import N,{cwd as _e}from"node:process";import P from"node:readline";import F from"node:fs";import I,{delimiter as ve,dirname as ye,normalize as be,resolve as xe}from"node:path";import{isDeepStrictEqual as Se,promisify as Ce,stripVTControlCharacters as we}from"node:util";import{parse as Te}from"oxc-parser";import Ee from"node:fs/promises";import De from"node:os";import{createRequire as Oe}from"module";import{spawn as ke}from"node:child_process";import{PassThrough as Ae}from"node:stream";import je from"fs";import Me from"os";import Ne from"path";import{createConfigLoader as Pe}from"unconfig";import Fe from"node:crypto";import Ie from"node:assert";var Le=`jsrepo`,Re=`A CLI to add shared code from remote repositories.`,ze=`3.8.0`,Be=t((e=>{let t={withStackTrace:!1},n=(e,n,r=t)=>({data:n.isOk()?{type:`Ok`,value:n.value}:{type:`Err`,value:n.error},message:e,stack:r.withStackTrace?Error().stack:void 0});function r(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function i(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function a(e){return this instanceof a?(this.v=e,this):new a(e)}function o(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),c(`next`),c(`throw`),c(`return`,s),i[Symbol.asyncIterator]=function(){return this},i;function s(e){return function(t){return Promise.resolve(t).then(e,f)}}function c(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||l(e,t)})},t&&(i[e]=t(i[e])))}function l(e,t){try{u(r[e](t))}catch(e){p(o[0][3],e)}}function u(e){e.value instanceof a?Promise.resolve(e.value.v).then(d,f):p(o[0][2],e)}function d(e){l(`next`,e)}function f(e){l(`throw`,e)}function p(e,t){e(t),o.shift(),o.length&&l(o[0][0],o[0][1])}}function s(e){var t,n;return t={},r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:a(e[r](t)),done:!1}:i?i(t):t}:i}}function c(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof i==`function`?i(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,i){n=e[t](n),a(r,i,n.done,n.value)})}}function a(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}var l=class e{constructor(e){this._promise=e}static fromSafePromise(t){return new e(t.then(e=>new S(e)))}static fromPromise(t,n,r){return new e(t.then(e=>new S(e)).catch(e=>new C(n(e))).finally(r))}static fromThrowable(t,n,i){return(...a)=>new e(r(this,void 0,void 0,function*(){try{return new S(yield t(...a))}catch(e){return new C(n?n(e):e)}finally{i?.()}}))}static combine(e){return g(e)}static combineWithAllErrors(e){return v(e)}map(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){return e.isErr()?new C(e.error):new S(yield t(e.value))})))}andThrough(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){if(e.isErr())return new C(e.error);let n=yield t(e.value);return n.isErr()?new C(n.error):new S(e.value)})))}andTee(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){if(e.isErr())return new C(e.error);try{yield t(e.value)}catch{}return new S(e.value)})))}orTee(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){if(e.isOk())return new S(e.value);try{yield t(e.error)}catch{}return new C(e.error)})))}mapErr(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){return e.isOk()?new S(e.value):new C(yield t(e.error))})))}andThen(t){return new e(this._promise.then(n=>{if(n.isErr())return new C(n.error);let r=t(n.value);return r instanceof e?r._promise:r}))}finally(t){return new e(this._promise.finally(t))}orElse(t){return new e(this._promise.then(e=>r(this,void 0,void 0,function*(){return e.isErr()?t(e.error):new S(e.value)})))}match(e,t){return r(this,void 0,void 0,function*(){return this._promise.then(n=>n.match(e,t))})}unwrapOr(e){return r(this,void 0,void 0,function*(){return this._promise.then(t=>t.unwrapOr(e))})}safeUnwrap(){return o(this,arguments,function*(){return yield a(yield a(yield*s(c(yield a(this._promise.then(e=>e.safeUnwrap()))))))})}then(e,t){return this._promise.then(e,t)}[Symbol.asyncIterator](){return o(this,arguments,function*(){let e=yield a(this._promise);return e.isErr()&&(yield yield a(d(e.error))),yield a(e.value)})}};function u(e){return new l(Promise.resolve(new S(e)))}function d(e){return new l(Promise.resolve(new C(e)))}let f=l.fromPromise,p=l.fromSafePromise,m=l.fromThrowable,h=e=>{let t=y([]);for(let n of e)if(n.isErr()){t=b(n.error);break}else t.map(e=>e.push(n.value));return t},g=e=>l.fromSafePromise(Promise.all(e)).andThen(h),_=e=>{let t=y([]);for(let n of e)n.isErr()&&t.isErr()?t.error.push(n.error):n.isErr()&&t.isOk()?t=b([n.error]):n.isOk()&&t.isOk()&&t.value.push(n.value);return t},v=e=>l.fromSafePromise(Promise.all(e)).andThen(_);e.ResultJson=void 0,(function(e){function t(e){return!!(typeof e==`object`&&e&&`__tag`in e&&(`error`in e||`value`in e))}e.is=t;function n(e){return e.__tag===`err`}e.isErr=n;function r(e){return e.__tag===`ok`}e.isOk=r;function i(e){return{__tag:`ok`,value:e}}e.ok=i;function a(e){return{__tag:`err`,error:e}}e.err=a})(e.ResultJson||={}),e.Result=void 0,(function(t){function n(e,t){return(...n)=>{try{return y(e(...n))}catch(e){return b(t?t(e):e)}}}t.fromThrowable=n;function r(e){return h(e)}t.combine=r;function i(e){return _(e)}t.combineWithAllErrors=i;function a(t){return e.ResultJson.isOk(t)?y(t.value):b(t.error)}t.fromJson=a})(e.Result||={});function y(e){return new S(e)}function b(e){return new C(e)}function x(e){let t=e().next();return t instanceof Promise?new l(t.then(e=>e.value)):t.value}var S=class{constructor(e){this.value=e,this.__tag=`ok`}toJson(){return{__tag:this.__tag,value:this.value}}isOk(){return!0}isErr(){return!this.isOk()}map(e){return y(e(this.value))}mapErr(e){return y(this.value)}andThen(e){return e(this.value)}andThrough(e){return e(this.value).map(e=>this.value)}andTee(e){try{e(this.value)}catch{}return y(this.value)}orTee(e){return y(this.value)}orElse(e){return y(this.value)}asyncAndThen(e){return e(this.value)}asyncAndThrough(e){return e(this.value).map(()=>this.value)}asyncMap(e){return l.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,t){return e(this.value)}expect(){return this.value}expectErr(e){throw e instanceof Error?e:n(e,this)}safeUnwrap(){let e=this.value;return(function*(){return e})()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw n("Called `_unsafeUnwrapErr` on an Ok",this,e)}*[Symbol.iterator](){return this.value}},C=class{constructor(e){this.error=e,this.__tag=`err`}toJson(){return{__tag:this.__tag,error:this.error}}isOk(){return!1}isErr(){return!this.isOk()}map(e){return b(this.error)}mapErr(e){return b(e(this.error))}andThrough(e){return b(this.error)}andTee(e){return b(this.error)}orTee(e){try{e(this.error)}catch{}return b(this.error)}andThen(e){return b(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return d(this.error)}asyncAndThrough(e){return d(this.error)}asyncMap(e){return d(this.error)}unwrapOr(e){return e}match(e,t){return t(this.error)}expect(e){throw e instanceof Error?e:n(e,this)}expectErr(){return this.error}safeUnwrap(){let e=this.error;return(function*(){throw yield b(e),Error("Do not use this generator out of `safeTry`")})()}_unsafeUnwrap(e){throw n("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}*[Symbol.iterator](){return yield this,this}};let w=e.Result.fromThrowable;e.Err=C,e.Ok=S,e.ResultAsync=l,e.err=b,e.errAsync=d,e.fromAsyncThrowable=m,e.fromPromise=f,e.fromSafePromise=p,e.fromThrowable=w,e.ok=y,e.okAsync=u,e.safeTry=x}));let Ve=()=>{var e=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},a=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(let c of n(a))!r.call(i,c)&&c!==o&&e(i,c,{get:()=>a[c],enumerable:!(s=t(a,c))||s.enumerable});return i},o=t=>a(e({},`__esModule`,{value:!0}),t),s={};i(s,{default:()=>Pe});var c=e=>Array.isArray(e),l=e=>typeof e==`function`,u=e=>e.length===0,d=e=>typeof e==`number`,f=e=>typeof e==`object`&&!!e,p=e=>e instanceof RegExp,m=e=>typeof e==`string`,h=e=>e===void 0,g=e=>{let t=new Map;return n=>{let r=t.get(n);if(r)return r;let i=e(n);return t.set(n,i),i}},_=(e,t,n={})=>{let r={cache:{},input:e,index:0,indexMax:0,options:n,output:[]};if(te(t)(r)&&r.index===e.length)return r.output;throw Error(`Failed to parse at index ${r.indexMax}`)},v=(e,t)=>c(e)?y(e,t):m(e)?x(e,t):b(e,t),y=(e,t)=>{let n={};for(let t of e){if(t.length!==1)throw Error(`Invalid character: "${t}"`);let e=t.charCodeAt(0);n[e]=!0}return e=>{let r=e.index,i=e.input;for(;e.index<i.length&&i.charCodeAt(e.index)in n;)e.index+=1;let a=e.index;if(a>r){if(!h(t)&&!e.options.silent){let n=e.input.slice(r,a),o=l(t)?t(n,i,String(r)):t;h(o)||e.output.push(o)}e.indexMax=Math.max(e.indexMax,e.index)}return!0}},b=(e,t)=>{let n=e.source,r=e.flags.replace(/y|$/,`y`),i=new RegExp(n,r);return O(e=>{i.lastIndex=e.index;let n=i.exec(e.input);if(n){if(!h(t)&&!e.options.silent){let r=l(t)?t(...n,e.input,String(e.index)):t;h(r)||e.output.push(r)}return e.index+=n[0].length,e.indexMax=Math.max(e.indexMax,e.index),!0}else return!1})},x=(e,t)=>n=>{if(n.input.startsWith(e,n.index)){if(!h(t)&&!n.options.silent){let r=l(t)?t(e,n.input,String(n.index)):t;h(r)||n.output.push(r)}return n.index+=e.length,n.indexMax=Math.max(n.indexMax,n.index),!0}else return!1},S=(e,t,n,r)=>{let i=te(e);return O(D(E(e=>{let r=0;for(;r<n;){let t=e.index;if(!i(e)||(r+=1,e.index===t))break}return r>=t})))},C=(e,t)=>S(e,0,1),w=(e,t)=>S(e,0,1/0),ee=(e,t)=>{let n=e.map(te);return O(D(E(e=>{for(let t=0,r=n.length;t<r;t++)if(!n[t](e))return!1;return!0})))},T=(e,t)=>{let n=e.map(te);return O(D(e=>{for(let t=0,r=n.length;t<r;t++)if(n[t](e))return!0;return!1}))},E=(e,t=!1)=>{let n=te(e);return e=>{let r=e.index,i=e.output.length,a=n(e);return(!a||t)&&(e.index=r,e.output.length!==i&&(e.output.length=i)),a}},D=(e,t)=>te(e),O=(()=>{let e=0;return t=>{let n=te(t),r=e+=1;return e=>{var t;if(e.options.memoization===!1)return n(e);let i=e.index,a=(t=e.cache)[r]||(t[r]=new Map),o=a.get(i);if(o===!1)return!1;if(d(o))return e.index=o,!0;if(o)return e.index=o.index,o.output?.length&&e.output.push(...o.output),!0;{let t=e.output.length;if(n(e)){let n=e.index,r=e.output.length;if(r>t){let o=e.output.slice(t,r);a.set(i,{index:n,output:o})}else a.set(i,n);return!0}else return a.set(i,!1),!1}}}})(),k=e=>{let t;return n=>(t||=te(e()),t(n))},te=g(e=>{if(l(e))return u(e)?k(e):e;if(m(e)||p(e))return v(e);if(c(e))return ee(e);if(f(e))return T(Object.values(e));throw Error(`Invalid rule`)}),ne=`abcdefghijklmnopqrstuvwxyz`,re=e=>{let t=``;for(;e>0;)t=ne[(e-1)%26]+t,e=Math.floor((e-1)/26);return t},ie=e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t=t*26+ne.indexOf(e[n])+1;return t},ae=(e,t)=>{if(t<e)return ae(t,e);let n=[];for(;e<=t;)n.push(e++);return n},oe=(e,t,n)=>ae(e,t).map(e=>String(e).padStart(n,`0`)),A=(e,t)=>ae(ie(e),ie(t)).map(re),se=e=>e,ce=e=>le(t=>_(t,e,{memoization:!1}).join(``)),le=e=>{let t={};return n=>t[n]??(t[n]=e(n))},j=v(/^\*\*\/\*$/,`.*`),M=v(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/,(e,t,n)=>`.*${t?``:`(?:^|/)`}${n.replaceAll(`.`,`\\.`)}`),ue=v(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/,(e,t,n,r)=>`.*${t?``:`(?:^|/)`}${n.replaceAll(`.`,`\\.`)}(?:${r.replaceAll(`,`,`|`).replaceAll(`.`,`\\.`)})`),de=v(/\\./,se),fe=v(/[$.*+?^(){}[\]\|]/,e=>`\\${e}`),pe=v(/./,se),me=T([v(/^(?:!!)*!(.*)$/,(e,t)=>`(?!^${ke(t)}$).*?`),v(/^(!!)+/,``)]),he=T([v(/\/(\*\*\/)+/,`(?:/.+/|/)`),v(/^(\*\*\/)+/,`(?:^|.*/)`),v(/\/(\*\*)$/,`(?:/.*|$)`),v(/\*\*/,`.*`)]),ge=T([v(/\*\/(?!\*\*\/)/,`[^/]*/`),v(/\*/,`[^/]*`)]),N=v(`?`,`[^/]`),_e=v(`[`,se),P=v(`]`,se),F=v(/[!^]/,`^/`),I=v(/[a-z]-[a-z]|[0-9]-[0-9]/i,se),ve=T([de,v(/[$.*+?^(){}[\|]/,e=>`\\${e}`),I,v(/[^\]]/,se)]),ye=ee([_e,C(F),w(ve),P]),be=v(`{`,`(?:`),xe=v(`}`,`)`),Se=ee([be,T([v(/(\d+)\.\.(\d+)/,(e,t,n)=>oe(+t,+n,Math.min(t.length,n.length)).join(`|`)),v(/([a-z]+)\.\.([a-z]+)/,(e,t,n)=>A(t,n).join(`|`)),v(/([A-Z]+)\.\.([A-Z]+)/,(e,t,n)=>A(t.toLowerCase(),n.toLowerCase()).join(`|`).toUpperCase())]),xe]),Ce=v(`{`,`(?:`),we=v(`}`,`)`),Te=v(`,`,`|`),Ee=v(/[$.*+?^(){[\]\|]/,e=>`\\${e}`),De=v(/[^}]/,se),Oe=ee([Ce,w(T([he,ge,N,ye,Se,k(()=>Oe),de,Ee,Te,De])),we]),ke=ce(w(T([j,M,ue,me,he,ge,N,ye,Se,Oe,de,fe,pe]))),Ae=v(/\\./,se),je=v(/./,se),Me=ce(w(T([Ae,v(/\*\*\*+/,`*`),v(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),v(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),je]))),Ne=(e,t)=>{let n=Array.isArray(e)?e:[e];if(!n.length)return!1;let r=n.map(Ne.compile),i=n.every(e=>/(\/(?:\*\*)?|\[\/\])$/.test(e)),a=t.replace(/[\\\/]+/g,`/`).replace(/\/$/,i?`/`:``);return r.some(e=>e.test(a))};Ne.compile=e=>RegExp(`^${ke(Me(e))}$`,`s`);var Pe=Ne;return o(s)})();return e.default||e},He;const Ue=(e,t)=>(He||(He=Ve(),Ve=null),He(e,t)),We=/^[A-Za-z]:\//;function Ge(e=``){return e&&e.replace(/\\/g,`/`).replace(We,e=>e.toUpperCase())}const Ke=/^[/\\]{2}/,qe=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Je=/^[A-Za-z]:$/,Ye=/^\/([A-Za-z]:)?$/,Xe=/.(\.[^./]+|\.)$/,Ze=/^[/\\]|^[a-zA-Z]:[/\\]/,Qe=function(e){if(e.length===0)return`.`;e=Ge(e);let t=e.match(Ke),n=rt(e),r=e[e.length-1]===`/`;return e=nt(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),Je.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!rt(e)?`/${e}`:e)},$e=function(...e){let t=``;for(let n of e)if(n)if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;e&&r?t+=n.slice(1):t+=e||r?n:`/${n}`}else t+=n;return Qe(t)};function et(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const tt=function(...e){e=e.map(e=>Ge(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:et();!i||i.length===0||(t=`${i}/${t}`,n=rt(i))}return t=nt(t,!n),n&&!rt(t)?`/${t}`:t.length>0?t:`.`};function nt(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}const rt=function(e){return qe.test(e)},it=function(e){return Ge(e)},at=function(e){if(e===`..`)return``;let t=Xe.exec(Ge(e));return t&&t[1]||``},ot=function(e,t){let n=tt(e).replace(Ye,`$1`).split(`/`),r=tt(t).replace(Ye,`$1`).split(`/`);if(r[0][1]===`:`&&n[0][1]===`:`&&n[0]!==r[0])return r.join(`/`);let i=[...n];for(let e of i){if(r[0]!==e)break;n.shift(),r.shift()}return[...n.map(()=>`..`),...r].join(`/`)},st=function(e){let t=Ge(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&Je.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(rt(e)?`/`:`.`)},ct=function(e){let t=e.ext?e.ext.startsWith(`.`)?e.ext:`.${e.ext}`:``,n=[e.root,e.dir,e.base??(e.name??``)+t].filter(Boolean);return Ge(e.root?tt(...n):n.join(`/`))},lt=function(e,t){let n=Ge(e).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return t&&r.endsWith(t)?r.slice(0,-t.length):r},ut={__proto__:null,basename:lt,dirname:st,extname:at,format:ct,isAbsolute:rt,join:$e,matchesGlob:(e,t)=>Ue(t,Qe(e)),normalize:Qe,normalizeString:nt,parse:function(e){let t=Ze.exec(e)?.[0]?.replace(/\\/g,`/`)||``,n=lt(e),r=at(n);return{root:t,dir:st(e),base:n,ext:r,name:n.slice(0,n.length-r.length)}},relative:ot,resolve:tt,sep:`/`,toNamespacedPath:it},dt=globalThis.process?.platform===`win32`?`;`:`:`,ft={posix:void 0,win32:void 0},pt=(e=dt)=>new Proxy(ut,{get(t,n){return n===`delimiter`?e:n===`posix`?L:n===`win32`?mt:ft[n]||ut[n]}}),L=pt(`:`),mt=pt(`;`);Object.freeze({status:`aborted`});function R(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var ht=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},gt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};const _t={};function vt(e){return e&&Object.assign(_t,e),_t}function yt(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function bt(e,t){return typeof t==`bigint`?t.toString():t}function xt(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function St(e){return e==null}function Ct(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function wt(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}const Tt=Symbol(`evaluating`);function Et(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Tt)return r===void 0&&(r=Tt,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Dt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ot(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function kt(e){return JSON.stringify(e)}function At(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const jt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Mt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Nt=xt(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Pt(e){if(Mt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Mt(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Ft(e){return Pt(e)?{...e}:Array.isArray(e)?[...e]:e}const It=new Set([`string`,`number`,`symbol`]);function Lt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Rt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function z(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function zt(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const Bt={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Vt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Rt(e,Ot(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Dt(this,`shape`,e),e},checks:[]}))}function Ht(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Rt(e,Ot(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Dt(this,`shape`,r),r},checks:[]}))}function Ut(e,t){if(!Pt(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Rt(e,Ot(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Dt(this,`shape`,n),n}}))}function Wt(e,t){if(!Pt(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Rt(e,Ot(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Dt(this,`shape`,n),n}}))}function Gt(e,t){return Rt(e,Ot(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Dt(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Kt(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Rt(t,Ot(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Dt(this,`shape`,i),i},checks:[]}))}function qt(e,t,n){return Rt(t,Ot(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Dt(this,`shape`,i),i}}))}function Jt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Yt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Xt(e){return typeof e==`string`?e:e?.message}function Zt(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Xt(e.inst?._zod.def?.error?.(e))??Xt(t?.error?.(e))??Xt(n.customError?.(e))??Xt(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Qt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function $t(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const en=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,bt,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},tn=R(`$ZodError`,en),nn=R(`$ZodError`,en,{Parent:Error});function rn(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function an(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}const on=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new ht;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Zt(e,a,vt())));throw jt(t,i?.callee),t}return o.value},sn=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Zt(e,a,vt())));throw jt(t,i?.callee),t}return o.value},cn=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ht;return a.issues.length?{success:!1,error:new(e??tn)(a.issues.map(e=>Zt(e,i,vt())))}:{success:!0,data:a.value}},ln=cn(nn),un=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Zt(e,i,vt())))}:{success:!0,data:a.value}},dn=un(nn),fn=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return on(e)(t,n,i)},pn=e=>(t,n,r)=>on(e)(t,n,r),mn=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return sn(e)(t,n,i)},hn=e=>async(t,n,r)=>sn(e)(t,n,r),gn=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return cn(e)(t,n,i)},_n=e=>(t,n,r)=>cn(e)(t,n,r),vn=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return un(e)(t,n,i)},yn=e=>async(t,n,r)=>un(e)(t,n,r),bn=/^[cC][^\s-]{8,}$/,xn=/^[0-9a-z]+$/,Sn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Cn=/^[0-9a-vA-V]{20}$/,wn=/^[A-Za-z0-9]{27}$/,Tn=/^[a-zA-Z0-9_-]{21}$/,En=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Dn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,On=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,kn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function An(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const jn=/^(?:(?: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])$/,Mn=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,Nn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Pn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,In=/^[A-Za-z0-9_-]*$/,Ln=/^\+[1-9]\d{6,14}$/,Rn=`(?:(?:\\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])))`,zn=RegExp(`^${Rn}$`);function Bn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Vn(e){return RegExp(`^${Bn(e)}$`)}function Hn(e){let t=Bn({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Rn}T(?:${r})$`)}const Un=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Wn=/^-?\d+$/,Gn=/^-?\d+(?:\.\d+)?$/,Kn=/^(?:true|false)$/i,qn=/^undefined$/i,Jn=/^[^A-Z]*$/,Yn=/^[^a-z]*$/,Xn=R(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Zn={number:`number`,bigint:`bigint`,object:`date`},Qn=R(`$ZodCheckLessThan`,(e,t)=>{Xn.init(e,t);let n=Zn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$n=R(`$ZodCheckGreaterThan`,(e,t)=>{Xn.init(e,t);let n=Zn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),er=R(`$ZodCheckMultipleOf`,(e,t)=>{Xn.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):wt(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),tr=R(`$ZodCheckNumberFormat`,(e,t)=>{Xn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Bt[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Wn)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),nr=R(`$ZodCheckMaxLength`,(e,t)=>{var n;Xn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!St(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Qt(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rr=R(`$ZodCheckMinLength`,(e,t)=>{var n;Xn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!St(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Qt(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ir=R(`$ZodCheckLengthEquals`,(e,t)=>{var n;Xn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!St(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Qt(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ar=R(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Xn.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),or=R(`$ZodCheckRegex`,(e,t)=>{ar.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),sr=R(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Jn,ar.init(e,t)}),cr=R(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Yn,ar.init(e,t)}),lr=R(`$ZodCheckIncludes`,(e,t)=>{Xn.init(e,t);let n=Lt(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ur=R(`$ZodCheckStartsWith`,(e,t)=>{Xn.init(e,t);let n=RegExp(`^${Lt(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),dr=R(`$ZodCheckEndsWith`,(e,t)=>{Xn.init(e,t);let n=RegExp(`.*${Lt(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),fr=R(`$ZodCheckOverwrite`,(e,t)=>{Xn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var pr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
2
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
3
3
|
`))}};const mr={major:4,minor:3,patch:6},hr=R(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=mr;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Jt(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new ht;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Jt(e,t))});else{if(e.issues.length===t)continue;r||=Jt(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Jt(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new ht;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new ht;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Et(e,`~standard`,()=>({validate:t=>{try{let n=ln(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return dn(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),gr=R(`$ZodString`,(e,t)=>{hr.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Un(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),_r=R(`$ZodStringFormat`,(e,t)=>{ar.init(e,t),gr.init(e,t)}),vr=R(`$ZodGUID`,(e,t)=>{t.pattern??=Dn,_r.init(e,t)}),yr=R(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=On(e)}else t.pattern??=On();_r.init(e,t)}),br=R(`$ZodEmail`,(e,t)=>{t.pattern??=kn,_r.init(e,t)}),xr=R(`$ZodURL`,(e,t)=>{_r.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Sr=R(`$ZodEmoji`,(e,t)=>{t.pattern??=An(),_r.init(e,t)}),Cr=R(`$ZodNanoID`,(e,t)=>{t.pattern??=Tn,_r.init(e,t)}),wr=R(`$ZodCUID`,(e,t)=>{t.pattern??=bn,_r.init(e,t)}),Tr=R(`$ZodCUID2`,(e,t)=>{t.pattern??=xn,_r.init(e,t)}),Er=R(`$ZodULID`,(e,t)=>{t.pattern??=Sn,_r.init(e,t)}),Dr=R(`$ZodXID`,(e,t)=>{t.pattern??=Cn,_r.init(e,t)}),Or=R(`$ZodKSUID`,(e,t)=>{t.pattern??=wn,_r.init(e,t)}),kr=R(`$ZodISODateTime`,(e,t)=>{t.pattern??=Hn(t),_r.init(e,t)}),Ar=R(`$ZodISODate`,(e,t)=>{t.pattern??=zn,_r.init(e,t)}),jr=R(`$ZodISOTime`,(e,t)=>{t.pattern??=Vn(t),_r.init(e,t)}),Mr=R(`$ZodISODuration`,(e,t)=>{t.pattern??=En,_r.init(e,t)}),Nr=R(`$ZodIPv4`,(e,t)=>{t.pattern??=jn,_r.init(e,t),e._zod.bag.format=`ipv4`}),Pr=R(`$ZodIPv6`,(e,t)=>{t.pattern??=Mn,_r.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Fr=R(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Nn,_r.init(e,t)}),Ir=R(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Pn,_r.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Lr(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Rr=R(`$ZodBase64`,(e,t)=>{t.pattern??=Fn,_r.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Lr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function zr(e){if(!In.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Lr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Br=R(`$ZodBase64URL`,(e,t)=>{t.pattern??=In,_r.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{zr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Vr=R(`$ZodE164`,(e,t)=>{t.pattern??=Ln,_r.init(e,t)});function Hr(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Ur=R(`$ZodJWT`,(e,t)=>{_r.init(e,t),e._zod.check=n=>{Hr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Wr=R(`$ZodNumber`,(e,t)=>{hr.init(e,t),e._zod.pattern=e._zod.bag.pattern??Gn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Gr=R(`$ZodNumberFormat`,(e,t)=>{tr.init(e,t),Wr.init(e,t)}),Kr=R(`$ZodBoolean`,(e,t)=>{hr.init(e,t),e._zod.pattern=Kn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),qr=R(`$ZodUndefined`,(e,t)=>{hr.init(e,t),e._zod.pattern=qn,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Jr=R(`$ZodUnknown`,(e,t)=>{hr.init(e,t),e._zod.parse=e=>e}),Yr=R(`$ZodNever`,(e,t)=>{hr.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Xr(e,t,n){e.issues.length&&t.issues.push(...Yt(n,e.issues)),t.value[n]=e.value}const Zr=R(`$ZodArray`,(e,t)=>{hr.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Xr(t,n,e))):Xr(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Qr(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Yt(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function $r(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=zt(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ei(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Qr(e,n,i,t,u))):Qr(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const ti=R(`$ZodObject`,(e,t)=>{if(hr.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=xt(()=>$r(t));Et(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Mt,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>Qr(n,t,e,s,r))):Qr(i,t,e,s,r)}return i?ei(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),ni=R(`$ZodObjectJIT`,(e,t)=>{ti.init(e,t);let n=e._zod.parse,r=xt(()=>$r(t)),i=e=>{let t=new pr([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=kt(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=kt(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|
|
4
4
|
if (${n}.issues.length) {
|
|
@@ -82,4 +82,4 @@ t.exports=r;let n=Ev();function r(e,t){let r,i,a,o=!0;Array.isArray(e)?(r=[],i=e
|
|
|
82
82
|
depsCount: ${n},
|
|
83
83
|
deps: ${r}}`};let i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);o(e,t),s(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===`__proto__`)continue;let i=Array.isArray(e[r])?t:n;i[r]=e[r]}return[t,n]}function o(e,n=e.schema){let{gen:i,data:a,it:o}=e;if(Object.keys(n).length===0)return;let s=i.let(`missing`);for(let c in n){let l=n[c];if(l.length===0)continue;let u=(0,r.propertyInData)(i,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(`, `)}),o.allErrors?i.if(u,()=>{for(let t of l)(0,r.checkReportMissingProp)(e,t)}):(i.if((0,t._)`${u} && (${(0,r.checkMissingProp)(e,l,s)})`),(0,r.reportMissingProp)(e,s),i.else())}}e.validatePropertyDeps=o;function s(e,t=e.schema){let{gen:i,data:a,keyword:o,it:s}=e,c=i.name(`valid`);for(let l in t)(0,n.alwaysValidSchema)(s,t[l])||(i.if((0,r.propertyInData)(i,a,l,s.opts.ownProperties),()=>{let t=e.subschema({keyword:o,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>i.var(c,!0)),e.ok(c))}e.validateSchemaDeps=s,e.default=i})),Nx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=$(),n=Vb();e.default={keyword:`propertyNames`,type:`object`,schemaType:[`object`,`boolean`],error:{message:`property name must be valid`,params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e;if((0,n.alwaysValidSchema)(o,i))return;let s=r.name(`valid`);r.forIn(`key`,a,n=>{e.setParams({propertyName:n}),e.subschema({keyword:`propertyNames`,data:n,dataTypes:[`string`],propertyName:n,compositeRule:!0},s),r.if((0,t.not)(s),()=>{e.error(!0),o.allErrors||r.break()})}),e.ok(s)}}})),Px=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Yb(),n=$(),r=Hb(),i=Vb();e.default={keyword:`additionalProperties`,type:[`object`],schemaType:[`boolean`,`object`],allowUndefined:!0,trackErrors:!0,error:{message:`must NOT have additional properties`,params:({params:e})=>(0,n._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:a,schema:o,parentSchema:s,data:c,errsCount:l,it:u}=e;if(!l)throw Error(`ajv implementation error`);let{allErrors:d,opts:f}=u;if(u.props=!0,f.removeAdditional!==`all`&&(0,i.alwaysValidSchema)(u,o))return;let p=(0,t.allSchemaProperties)(s.properties),m=(0,t.allSchemaProperties)(s.patternProperties);h(),e.ok((0,n._)`${l} === ${r.default.errors}`);function h(){a.forIn(`key`,c,e=>{!p.length&&!m.length?v(e):a.if(g(e),()=>v(e))})}function g(r){let o;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,s.properties,`properties`);o=(0,t.isOwnProperty)(a,e,r)}else o=p.length?(0,n.or)(...p.map(e=>(0,n._)`${r} === ${e}`)):n.nil;return m.length&&(o=(0,n.or)(o,...m.map(i=>(0,n._)`${(0,t.usePattern)(e,i)}.test(${r})`))),(0,n.not)(o)}function _(e){a.code((0,n._)`delete ${c}[${e}]`)}function v(t){if(f.removeAdditional===`all`||f.removeAdditional&&o===!1){_(t);return}if(o===!1){e.setParams({additionalProperty:t}),e.error(),d||a.break();return}if(typeof o==`object`&&!(0,i.alwaysValidSchema)(u,o)){let r=a.name(`valid`);f.removeAdditional===`failing`?(y(t,r,!1),a.if((0,n.not)(r),()=>{e.reset(),_(t)})):(y(t,r),d||a.if((0,n.not)(r),()=>a.break()))}}function y(t,n,r){let a={keyword:`additionalProperties`,dataProp:t,dataPropType:i.Type.Str};r===!1&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,n)}}}})),Fx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=tx(),n=Yb(),r=Vb(),i=Px();e.default={keyword:`properties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,parentSchema:s,data:c,it:l}=e;l.opts.removeAdditional===`all`&&s.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(l,i.default,`additionalProperties`));let u=(0,n.allSchemaProperties)(o);for(let e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&l.props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(u),l.props));let d=u.filter(e=>!(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0)return;let f=a.name(`valid`);for(let t of d)p(t)?m(t):(a.if((0,n.propertyInData)(a,c,t,l.opts.ownProperties)),m(t),l.allErrors||a.else().var(f,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(f);function p(e){return l.opts.useDefaults&&!l.compositeRule&&o[e].default!==void 0}function m(t){e.subschema({keyword:`properties`,schemaProp:t,dataProp:t},f)}}}})),Ix=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Yb(),n=$(),r=Vb(),i=Vb();e.default={keyword:`patternProperties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,data:s,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,t.allSchemaProperties)(o),f=d.filter(e=>(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0||f.length===d.length&&(!l.opts.unevaluated||l.props===!0))return;let p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=a.name(`valid`);l.props!==!0&&!(l.props instanceof n.Name)&&(l.props=(0,i.evaluatedPropsToName)(a,l.props));let{props:h}=l;g();function g(){for(let e of d)p&&_(e),l.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}function _(e){for(let t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn(`key`,s,o=>{a.if((0,n._)`${(0,t.usePattern)(e,r)}.test(${o})`,()=>{let t=f.includes(r);t||e.subschema({keyword:`patternProperties`,schemaProp:r,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&h!==!0?a.assign((0,n._)`${h}[${o}]`,!0):!t&&!l.allErrors&&a.if((0,n.not)(m),()=>a.break())})})}}}})),Lx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Vb();e.default={keyword:`not`,schemaType:[`object`,`boolean`],trackErrors:!0,code(e){let{gen:n,schema:r,it:i}=e;if((0,t.alwaysValidSchema)(i,r)){e.fail();return}let a=n.name(`valid`);e.subschema({keyword:`not`,compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:`must NOT be valid`}}})),Rx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={keyword:`anyOf`,schemaType:`array`,trackErrors:!0,code:Yb().validateUnion,error:{message:`must match a schema in anyOf`}}})),zx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=$(),n=Vb();e.default={keyword:`oneOf`,schemaType:`array`,trackErrors:!0,error:{message:`must match exactly one schema in oneOf`,params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:r,schema:i,parentSchema:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(o.opts.discriminator&&a.discriminator)return;let s=i,c=r.let(`valid`,!1),l=r.let(`passing`,null),u=r.name(`_valid`);e.setParams({passing:l}),r.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((i,a)=>{let s;(0,n.alwaysValidSchema)(o,i)?r.var(u,!0):s=e.subschema({keyword:`oneOf`,schemaProp:a,compositeRule:!0},u),a>0&&r.if((0,t._)`${u} && ${c}`).assign(c,!1).assign(l,(0,t._)`[${l}, ${a}]`).else(),r.if(u,()=>{r.assign(c,!0),r.assign(l,a),s&&e.mergeEvaluated(s,t.Name)})})}}}})),Bx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Vb();e.default={keyword:`allOf`,schemaType:`array`,code(e){let{gen:n,schema:r,it:i}=e;if(!Array.isArray(r))throw Error(`ajv implementation error`);let a=n.name(`valid`);r.forEach((n,r)=>{if((0,t.alwaysValidSchema)(i,n))return;let o=e.subschema({keyword:`allOf`,schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}}})),Vx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=$(),n=Vb(),r={keyword:`if`,schemaType:[`object`,`boolean`],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:r,parentSchema:a,it:o}=e;a.then===void 0&&a.else===void 0&&(0,n.checkStrictMode)(o,`"if" without "then" and "else" is ignored`);let s=i(o,`then`),c=i(o,`else`);if(!s&&!c)return;let l=r.let(`valid`,!0),u=r.name(`_valid`);if(d(),e.reset(),s&&c){let t=r.let(`ifClause`);e.setParams({ifClause:t}),r.if(u,f(`then`,t),f(`else`,t))}else s?r.if(u,f(`then`)):r.if((0,t.not)(u),f(`else`));e.pass(l,()=>e.error(!0));function d(){let t=e.subschema({keyword:`if`,compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}function f(n,i){return()=>{let a=e.subschema({keyword:n},u);r.assign(l,u),e.mergeValidEvaluated(a,l),i?r.assign(i,(0,t._)`${n}`):e.setParams({ifClause:n})}}}};function i(e,t){let r=e.schema[t];return r!==void 0&&!(0,n.alwaysValidSchema)(e,r)}e.default=r})),Hx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Vb();e.default={keyword:[`then`,`else`],schemaType:[`object`,`boolean`],code({keyword:e,parentSchema:n,it:r}){n.if===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}})),Ux=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Dx(),n=kx(),r=Ox(),i=Ax(),a=jx(),o=Mx(),s=Nx(),c=Px(),l=Fx(),u=Ix(),d=Lx(),f=Rx(),p=zx(),m=Bx(),h=Vx(),g=Hx();function _(e=!1){let _=[d.default,f.default,p.default,m.default,h.default,g.default,s.default,c.default,o.default,l.default,u.default];return e?_.push(n.default,i.default):_.push(t.default,r.default),_.push(a.default),_}e.default=_})),Wx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicAnchor=void 0;let t=$(),n=Hb(),r=ix(),i=fx(),a={keyword:`$dynamicAnchor`,schemaType:`string`,code:e=>o(e,e.schema)};function o(e,r){let{gen:i,it:a}=e;a.schemaEnv.root.dynamicAnchors[r]=!0;let o=(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(r)}`,c=a.errSchemaPath===`#`?a.validateName:s(e);i.if((0,t._)`!${o}`,()=>i.assign(o,c))}e.dynamicAnchor=o;function s(e){let{schemaEnv:t,schema:n,self:a}=e.it,{root:o,baseId:s,localRefs:c,meta:l}=t.root,{schemaId:u}=a.opts,d=new r.SchemaEnv({schema:n,schemaId:u,root:o,baseId:s,localRefs:c,meta:l});return r.compileSchema.call(a,d),(0,i.getValidate)(e,d)}e.default=a})),Gx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicRef=void 0;let t=$(),n=Hb(),r=fx(),i={keyword:`$dynamicRef`,schemaType:`string`,code:e=>a(e,e.schema)};function a(e,i){let{gen:a,keyword:o,it:s}=e;if(i[0]!==`#`)throw Error(`"${o}" only supports hash fragment reference`);let c=i.slice(1);if(s.allErrors)l();else{let t=a.let(`valid`,!1);l(t),e.ok(t)}function l(e){if(s.schemaEnv.root.dynamicAnchors[c]){let r=a.let(`_v`,(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(c)}`);a.if(r,u(r,e),u(s.validateName,e))}else u(s.validateName,e)()}function u(t,n){return n?()=>a.block(()=>{(0,r.callRef)(e,t),a.let(n,!0)}):()=>(0,r.callRef)(e,t)}}e.dynamicRef=a,e.default=i})),Kx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Wx(),n=Vb();e.default={keyword:`$recursiveAnchor`,schemaType:`boolean`,code(e){e.schema?(0,t.dynamicAnchor)(e,``):(0,n.checkStrictMode)(e.it,`$recursiveAnchor: false is ignored`)}}})),qx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Gx();e.default={keyword:`$recursiveRef`,schemaType:`string`,code:e=>(0,t.dynamicRef)(e,e.schema)}})),Jx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Wx(),n=Gx(),r=Kx(),i=qx();e.default=[t.default,n.default,r.default,i.default]})),Yx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Mx();e.default={keyword:`dependentRequired`,type:`object`,schemaType:`object`,error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}})),Xx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Mx();e.default={keyword:`dependentSchemas`,type:`object`,schemaType:`object`,code:e=>(0,t.validateSchemaDeps)(e)}})),Zx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Vb();e.default={keyword:[`maxContains`,`minContains`],type:`array`,schemaType:`number`,code({keyword:e,parentSchema:n,it:r}){n.contains===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}}})),Qx=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Yx(),n=Xx(),r=Zx();e.default=[t.default,n.default,r.default]})),$x=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=$(),n=Vb(),r=Hb();e.default={keyword:`unevaluatedProperties`,type:`object`,schemaType:[`boolean`,`object`],trackErrors:!0,error:{message:`must NOT have unevaluated properties`,params:({params:e})=>(0,t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:i,schema:a,data:o,errsCount:s,it:c}=e;if(!s)throw Error(`ajv implementation error`);let{allErrors:l,props:u}=c;u instanceof t.Name?i.if((0,t._)`${u} !== true`,()=>i.forIn(`key`,o,e=>i.if(f(u,e),()=>d(e)))):u!==!0&&i.forIn(`key`,o,e=>u===void 0?d(e):i.if(p(u,e),()=>d(e))),c.props=!0,e.ok((0,t._)`${s} === ${r.default.errors}`);function d(r){if(a===!1){e.setParams({unevaluatedProperty:r}),e.error(),l||i.break();return}if(!(0,n.alwaysValidSchema)(c,a)){let a=i.name(`valid`);e.subschema({keyword:`unevaluatedProperties`,dataProp:r,dataPropType:n.Type.Str},a),l||i.if((0,t.not)(a),()=>i.break())}}function f(e,n){return(0,t._)`!${e} || !${e}[${n}]`}function p(e,n){let r=[];for(let i in e)e[i]===!0&&r.push((0,t._)`${n} !== ${i}`);return(0,t.and)(...r)}}}})),eS=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=$(),n=Vb();e.default={keyword:`unevaluatedItems`,type:`array`,schemaType:[`boolean`,`object`],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e,s=o.items||0;if(s===!0)return;let c=r.const(`len`,(0,t._)`${a}.length`);if(i===!1)e.setParams({len:s}),e.fail((0,t._)`${c} > ${s}`);else if(typeof i==`object`&&!(0,n.alwaysValidSchema)(o,i)){let n=r.var(`valid`,(0,t._)`${c} <= ${s}`);r.if((0,t.not)(n),()=>l(n,s)),e.ok(n)}o.items=!0;function l(i,a){r.forRange(`i`,a,c,a=>{e.subschema({keyword:`unevaluatedItems`,dataProp:a,dataPropType:n.Type.Num},i),o.allErrors||r.if((0,t.not)(i),()=>r.break())})}}}})),tS=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=$x(),n=eS();e.default=[t.default,n.default]})),nS=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=$();e.default={keyword:`format`,type:[`number`,`string`],schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,n){let{gen:r,data:i,$data:a,schema:o,schemaCode:s,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=c;if(!l.validateFormats)return;a?p():m();function p(){let a=r.scopeValue(`formats`,{ref:f.formats,code:l.code.formats}),o=r.const(`fDef`,(0,t._)`${a}[${s}]`),c=r.let(`fType`),u=r.let(`format`);r.if((0,t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(c,(0,t._)`${o}.type || "string"`).assign(u,(0,t._)`${o}.validate`),()=>r.assign(c,(0,t._)`"string"`).assign(u,o)),e.fail$data((0,t.or)(p(),m()));function p(){return l.strictSchema===!1?t.nil:(0,t._)`${s} && !${u}`}function m(){let e=d.$async?(0,t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))`:(0,t._)`${u}(${i})`,r=(0,t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return(0,t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`}}function m(){let a=f.formats[o];if(!a){m();return}if(a===!0)return;let[s,c,p]=h(a);s===n&&e.pass(g());function m(){if(l.strictSchema===!1){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function h(e){let n=e instanceof RegExp?(0,t.regexpCode)(e):l.code.formats?(0,t._)`${l.code.formats}${(0,t.getProperty)(o)}`:void 0,i=r.scopeValue(`formats`,{key:o,ref:e,code:n});return typeof e==`object`&&!(e instanceof RegExp)?[e.type||`string`,e.validate,(0,t._)`${i}.validate`]:[`string`,e,i]}function g(){if(typeof a==`object`&&!(a instanceof RegExp)&&a.async){if(!d.$async)throw Error(`async format in sync schema`);return(0,t._)`await ${p}(${i})`}return typeof c==`function`?(0,t._)`${p}(${i})`:(0,t._)`${p}.test(${i})`}}}}})),rS=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=[nS().default]})),iS=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=[`title`,`description`,`default`,`deprecated`,`readOnly`,`writeOnly`,`examples`],e.contentVocabulary=[`contentMediaType`,`contentEncoding`,`contentSchema`]})),aS=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=px(),n=Ex(),r=Ux(),i=Jx(),a=Qx(),o=tS(),s=rS(),c=iS();e.default=[i.default,t.default,n.default,(0,r.default)(!0),s.default,c.metadataVocabulary,c.contentVocabulary,a.default,o.default]})),oS=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DiscrError=void 0;var t;(function(e){e.Tag=`tag`,e.Mapping=`mapping`})(t||(e.DiscrError=t={}))})),sS=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=$(),n=oS(),r=ix(),i=rx(),a=Vb();e.default={keyword:`discriminator`,type:`object`,schemaType:`object`,error:{message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:n,tagName:r}})=>(0,t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`},code(e){let{gen:o,data:s,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw Error(`discriminator: requires discriminator option`);let f=c.propertyName;if(typeof f!=`string`)throw Error(`discriminator: requires propertyName`);if(c.mapping)throw Error(`discriminator: mapping is not supported`);if(!d)throw Error(`discriminator: requires oneOf keyword`);let p=o.let(`valid`,!1),m=o.const(`tag`,(0,t._)`${s}${(0,t.getProperty)(f)}`);o.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:m,tagName:f})),e.ok(p);function h(){let r=_();for(let e in o.if(!1),r)o.elseIf((0,t._)`${m} === ${e}`),o.assign(p,g(r[e]));o.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:m,tagName:f}),o.endIf()}function g(n){let r=o.name(`valid`),i=e.subschema({keyword:`oneOf`,schemaProp:n},r);return e.mergeEvaluated(i,t.Name),r}function _(){let e={},t=o(l),n=!0;for(let e=0;e<d.length;e++){let c=d[e];if(c?.$ref&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if(c=r.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof r.SchemaEnv&&(c=c.schema),c===void 0)throw new i.default(u.opts.uriResolver,u.baseId,e)}let l=c?.properties?.[f];if(typeof l!=`object`)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n&&=t||o(c),s(l,e)}if(!n)throw Error(`discriminator: "${f}" must be required`);return e;function o({required:e}){return Array.isArray(e)&&e.includes(f)}function s(e,t){if(e.const)c(e.const,t);else if(e.enum)for(let n of e.enum)c(n,t);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function c(t,n){if(typeof t!=`string`||t in e)throw Error(`discriminator: "${f}" values must be unique strings`);e[t]=n}}}}})),cS=t(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/schema`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Core and Validation specifications meta-schema`,allOf:[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],type:[`object`,`boolean`],$comment:`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,properties:{definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}}}})),lS=t(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/applicator`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:`meta`,title:`Applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},$defs:{schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}}}})),uS=t(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/unevaluated`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:`meta`,title:`Unevaluated applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}}}})),dS=t(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/content`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Content vocabulary meta-schema`,type:[`object`,`boolean`],properties:{contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}}}})),fS=t(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/core`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:`meta`,title:`Core vocabulary meta-schema`,type:[`object`,`boolean`],properties:{$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},$defs:{anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}}}})),pS=t(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/format-annotation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:`meta`,title:`Format vocabulary meta-schema for annotation results`,type:[`object`,`boolean`],properties:{format:{type:`string`}}}})),mS=t(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/meta-data`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:`meta`,title:`Meta-data vocabulary meta-schema`,type:[`object`,`boolean`],properties:{title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}}}})),hS=t(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/validation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:`meta`,title:`Validation vocabulary meta-schema`,type:[`object`,`boolean`],properties:{type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},$defs:{nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}}}})),gS=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=cS(),n=lS(),r=uS(),i=dS(),a=fS(),o=pS(),s=mS(),c=hS(),l=[`/properties`];function u(e){return[t,n,r,i,a,u(this,o),s,u(this,c)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function u(t,n){return e?t.$dataMetaSchema(n,l):n}}e.default=u})),_S=t(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let n=ux(),r=aS(),i=sS(),a=gS(),o=`https://json-schema.org/draft/2020-12/schema`;var s=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(a.default.call(this,e),this.refs[`http://json-schema.org/schema`]=o)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=s;var c=tx();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return c.KeywordCxt}});var l=$();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return l.CodeGen}});var u=nx();Object.defineProperty(e,`ValidationError`,{enumerable:!0,get:function(){return u.default}});var d=rx();Object.defineProperty(e,`MissingRefError`,{enumerable:!0,get:function(){return d.default}})})),vS=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:T,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:`number`,validate:S},int64:{type:`number`,validate:C},float:{type:`number`,validate:w},double:{type:`number`,validate:w},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}let r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}let s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){let n=s.exec(t);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=n[4],c=n[5]===`-`?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e<t?-1:0}let d=/t|\s/i;function f(e){let t=c(e);return function(e){let n=e.split(d);return n.length===2&&a(n[0])&&t(n[1])}}function p(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(n&&r)return n-r}function m(e,t){if(!(e&&t))return;let[n,r]=e.split(d),[i,a]=t.split(d),s=o(n,i);if(s!==void 0)return s||l(r,a)}let h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(e){return h.test(e)&&g.test(e)}let v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(e){return v.lastIndex=0,v.test(e)}let b=-(2**31),x=2**31-1;function S(e){return Number.isInteger(e)&&e<=x&&e>=b}function C(e){return Number.isInteger(e)}function w(){return!0}let ee=/[^\\]\\Z/;function T(e){if(ee.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),yS=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=px(),n=Ex(),r=Ux(),i=rS(),a=iS();e.default=[t.default,n.default,(0,r.default)(),i.default,a.metadataVocabulary,a.contentVocabulary]})),bS=t(((e,t)=>{t.exports={$schema:`http://json-schema.org/draft-07/schema#`,$id:`http://json-schema.org/draft-07/schema#`,title:`Core schema meta-schema`,definitions:{schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},type:[`object`,`boolean`],properties:{$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},default:!0}})),xS=t(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let n=ux(),r=yS(),i=sS(),a=bS(),o=[`/properties`],s=`http://json-schema.org/draft-07/schema`;var c=class extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(a,o):a;this.addMetaSchema(e,s,!1),this.refs[`http://json-schema.org/schema`]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=c;var l=tx();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return l.KeywordCxt}});var u=$();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return u.CodeGen}});var d=nx();Object.defineProperty(e,`ValidationError`,{enumerable:!0,get:function(){return d.default}});var f=rx();Object.defineProperty(e,`MissingRefError`,{enumerable:!0,get:function(){return f.default}})})),SS=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.formatLimitDefinition=void 0;let t=xS(),n=$(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),CS=t(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0});let n=vS(),r=SS(),i=$(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=s}));const wS=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);!TS(i,a)&&r||Object.defineProperty(e,n,a)},TS=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},ES=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},DS=(e,t)=>`/* Wrapped ${e}*/\n${t}`,OS=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),kS=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),AS=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=DS.bind(null,r,t.toString());Object.defineProperty(i,`name`,kS);let{writable:a,enumerable:o,configurable:s}=OS;Object.defineProperty(e,`toString`,{value:i,writable:a,enumerable:o,configurable:s})};function jS(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))wS(e,t,r,n);return ES(e,t),AS(e,t,r),e}var MS=(e,t={})=>{if(typeof e!=`function`)throw TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);let{wait:n=0,maxWait:r=1/0,before:i=!1,after:a=!0}=t;if(n<0||r<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!a)throw Error("Both `before` and `after` are false, function wouldn't be called.");let o,s,c,l=function(...t){let l=this,u=()=>{o=void 0,s&&=(clearTimeout(s),void 0),a&&(c=e.apply(l,t))},d=()=>{s=void 0,o&&=(clearTimeout(o),void 0),a&&(c=e.apply(l,t))},f=i&&!o;return clearTimeout(o),o=setTimeout(u,n),r>0&&r!==1/0&&!s&&(s=setTimeout(d,r)),f&&(c=e.apply(l,t)),c};return jS(l,e),l.cancel=()=>{o&&=(clearTimeout(o),void 0),s&&=(clearTimeout(s),void 0)},l};const NS=Object.prototype.toString;function PS(e,t,n){return e?e.constructor===t?!0:NS.call(e)===n:!1}function FS(e){return PS(e,Uint8Array,`[object Uint8Array]`)}function IS(e){return PS(e,ArrayBuffer,`[object ArrayBuffer]`)}function LS(e){return FS(e)||IS(e)}function RS(e){if(!FS(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function zS(e){if(!LS(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function BS(e,t){if(e.length===0)return new Uint8Array;t??=e.reduce((e,t)=>e+t.length,0);let n=new Uint8Array(t),r=0;for(let t of e)RS(t),n.set(t,r),r+=t.length;return n}const VS={utf8:new globalThis.TextDecoder(`utf8`)};function HS(e,t=`utf8`){return zS(e),VS[t]??=new globalThis.TextDecoder(t),VS[t].decode(e)}function US(e){if(typeof e!=`string`)throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}const WS=new globalThis.TextEncoder;function GS(e){return US(e),WS.encode(e)}Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));var KS=_S(),qS=e(CS(),1);const JS=`aes-256-cbc`,YS=new Set([`aes-256-cbc`,`aes-256-gcm`,`aes-256-ctr`]),XS=e=>typeof e==`string`&&YS.has(e),ZS=()=>Object.create(null),QS=e=>e!==void 0,$S=(e,t)=>{let n=new Set([`undefined`,`symbol`,`function`]),r=typeof t;if(n.has(r))throw TypeError(`Setting a value of type \`${r}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},eC=`__internal__`,tC=`${eC}.migrations.version`;var nC=class{path;events;#e;#t;#n;#r;#i={};#a=!1;#o;#s;#c;constructor(e={}){let t=this.#l(e);this.#r=t,this.#u(t),this.#f(t),this.#p(t),this.events=new EventTarget,this.#t=t.encryptionKey,this.#n=t.encryptionAlgorithm??JS,this.path=this.#m(t),this.#h(t),t.watch&&this._watch()}get(e,t){if(this.#r.accessPropertiesByDotNotation)return this._get(e,t);let{store:n}=this;return e in n?n[e]:t}set(e,t){if(typeof e!=`string`&&typeof e!=`object`)throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!=`object`&&t===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw TypeError(`Please don't use the ${eC} key, as it's used to manage this module internal operations.`);let{store:n}=this,r=(e,t)=>{if($S(e,t),this.#r.accessPropertiesByDotNotation)rb(n,e,t);else{if(e===`__proto__`||e===`constructor`||e===`prototype`)return;n[e]=t}};if(typeof e==`object`){let t=e;for(let[e,n]of Object.entries(t))r(e,n)}else r(e,t);this.store=n}has(e){return this.#r.accessPropertiesByDotNotation?ab(this.store,e):e in this.store}appendToArray(e,t){$S(e,t);let n=this.#r.accessPropertiesByDotNotation?this._get(e,[]):e in this.store?this.store[e]:[];if(!Array.isArray(n))throw TypeError(`The key \`${e}\` is already set to a non-array value`);this.set(e,[...n,t])}reset(...e){for(let t of e)QS(this.#i[t])&&this.set(t,this.#i[t])}delete(e){let{store:t}=this;this.#r.accessPropertiesByDotNotation?ib(t,e):delete t[e],this.store=t}clear(){let e=ZS();for(let t of Object.keys(this.#i))QS(this.#i[t])&&($S(t,this.#i[t]),this.#r.accessPropertiesByDotNotation?rb(e,t,this.#i[t]):e[t]=this.#i[t]);this.store=e}onDidChange(e,t){if(typeof e!=`string`)throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof t!=`function`)throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleValueChange(()=>this.get(e),t)}onDidAnyChange(e){if(typeof e!=`function`)throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleStoreChange(e)}get size(){return Object.keys(this.store).filter(e=>!this._isReservedKeyPath(e)).length}get store(){try{let e=F.readFileSync(this.path,this.#t?null:`utf8`);return(e=>{let t=this._deserialize(e);return this.#a||this._validate(t),Object.assign(ZS(),t)})(this._decryptData(e))}catch(e){if(e?.code===`ENOENT`)return this._ensureDirectory(),ZS();if(this.#r.clearInvalidConfig){let t=e;if(t.name===`SyntaxError`||t.message?.startsWith(`Config schema violation:`)||t.message===`Failed to decrypt config data.`)return ZS()}throw e}}set store(e){if(this._ensureDirectory(),!ab(e,eC))try{let t=F.readFileSync(this.path,this.#t?null:`utf8`),n=this._decryptData(t),r=this._deserialize(n);ab(r,eC)&&rb(e,eC,nb(r,eC))}catch{}this.#a||this._validate(e),this._write(e),this.events.dispatchEvent(new Event(`change`))}*[Symbol.iterator](){for(let[e,t]of Object.entries(this.store))this._isReservedKeyPath(e)||(yield[e,t])}_closeWatcher(){this.#o&&=(this.#o.close(),void 0),this.#s&&=(F.unwatchFile(this.path),!1),this.#c=void 0}_decryptData(e){let t=this.#t;if(!t)return typeof e==`string`?e:HS(e);let n=this.#n,r=n===`aes-256-gcm`?16:0,i=`:`.codePointAt(0),a=typeof e==`string`?e.codePointAt(16):e[16];if(!(i!==void 0&&a===i)){if(n===`aes-256-cbc`)return typeof e==`string`?e:HS(e);throw Error(`Failed to decrypt config data.`)}let o=e=>{if(r===0)return{ciphertext:e};let t=e.length-r;if(t<0)throw Error(`Invalid authentication tag length.`);return{ciphertext:e.slice(0,t),authenticationTag:e.slice(t)}},s=e.slice(0,16),c=e.slice(17),l=typeof c==`string`?GS(c):c,u=e=>{let{ciphertext:r,authenticationTag:i}=o(l),a=Fe.pbkdf2Sync(t,e,1e4,32,`sha512`),c=Fe.createDecipheriv(n,a,s);return i&&c.setAuthTag(i),HS(BS([c.update(r),c.final()]))};try{return u(s)}catch{try{return u(s.toString())}catch{}}if(n===`aes-256-cbc`)return typeof e==`string`?e:HS(e);throw Error(`Failed to decrypt config data.`)}_handleStoreChange(e){let t=this.store,n=()=>{let n=t,r=this.store;Se(r,n)||(t=r,e.call(this,r,n))};return this.events.addEventListener(`change`,n),()=>{this.events.removeEventListener(`change`,n)}}_handleValueChange(e,t){let n=e(),r=()=>{let r=n,i=e();Se(i,r)||(n=i,t.call(this,i,r))};return this.events.addEventListener(`change`,r),()=>{this.events.removeEventListener(`change`,r)}}_deserialize=e=>JSON.parse(e);_serialize=e=>JSON.stringify(e,void 0,` `);_validate(e){if(!this.#e||this.#e(e)||!this.#e.errors)return;let t=this.#e.errors.map(({instancePath:e,message:t=``})=>`\`${e.slice(1)}\` ${t}`);throw Error(`Config schema violation: `+t.join(`; `))}_ensureDirectory(){F.mkdirSync(I.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e),n=this.#t;if(n){let e=Fe.randomBytes(16),r=Fe.pbkdf2Sync(n,e,1e4,32,`sha512`),i=Fe.createCipheriv(this.#n,r,e),a=BS([i.update(GS(t)),i.final()]),o=[e,GS(`:`),a];this.#n===`aes-256-gcm`&&o.push(i.getAuthTag()),t=BS(o)}if(N.env.SNAP)F.writeFileSync(this.path,t,{mode:this.#r.configFileMode});else try{Rb(this.path,t,{mode:this.#r.configFileMode})}catch(e){if(e?.code===`EXDEV`){F.writeFileSync(this.path,t,{mode:this.#r.configFileMode});return}throw e}}_watch(){if(this._ensureDirectory(),F.existsSync(this.path)||this._write(ZS()),N.platform===`win32`||N.platform===`darwin`){this.#c??=MS(()=>{this.events.dispatchEvent(new Event(`change`))},{wait:100});let e=I.dirname(this.path),t=I.basename(this.path);this.#o=F.watch(e,{persistent:!1,encoding:`utf8`},(e,n)=>{n&&n!==t||typeof this.#c==`function`&&this.#c()})}else this.#c??=MS(()=>{this.events.dispatchEvent(new Event(`change`))},{wait:1e3}),F.watchFile(this.path,{persistent:!1},(e,t)=>{typeof this.#c==`function`&&this.#c()}),this.#s=!0}_migrate(e,t,n){let r=this._get(tC,`0.0.0`),i=Object.keys(e).filter(e=>this._shouldPerformMigration(e,r,t)),a=structuredClone(this.store);for(let o of i)try{n&&n(this,{fromVersion:r,toVersion:o,finalVersion:t,versions:i});let s=e[o];s?.(this),this._set(tC,o),r=o,a=structuredClone(this.store)}catch(e){this.store=a;let t=e instanceof Error?e.message:String(e);throw Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${t}`)}(this._isVersionInRangeFormat(r)||!ql.default.eq(r,t))&&this._set(tC,t)}_containsReservedKey(e){return typeof e==`string`?this._isReservedKeyPath(e):!e||typeof e!=`object`?!1:this._objectContainsReservedKey(e)}_objectContainsReservedKey(e){if(!e||typeof e!=`object`)return!1;for(let[t,n]of Object.entries(e))if(this._isReservedKeyPath(t)||this._objectContainsReservedKey(n))return!0;return!1}_isReservedKeyPath(e){return e===eC||e.startsWith(`${eC}.`)}_isVersionInRangeFormat(e){return ql.default.clean(e)===null}_shouldPerformMigration(e,t,n){return this._isVersionInRangeFormat(e)?t!==`0.0.0`&&ql.default.satisfies(t,e)?!1:ql.default.satisfies(n,e):!(ql.default.lte(e,t)||ql.default.gt(e,n))}_get(e,t){return nb(this.store,e,t)}_set(e,t){let{store:n}=this;rb(n,e,t),this.store=n}#l(e){let t={configName:`config`,fileExtension:`json`,projectSuffix:`nodejs`,clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(t.encryptionAlgorithm??=JS,!XS(t.encryptionAlgorithm))throw TypeError(`The \`encryptionAlgorithm\` option must be one of: ${[...YS].join(`, `)}`);if(!t.cwd){if(!t.projectName)throw Error("Please specify the `projectName` option.");t.cwd=fb(t.projectName,{suffix:t.projectSuffix}).config}return typeof t.fileExtension==`string`&&(t.fileExtension=t.fileExtension.replace(/^\.+/,``)),t}#u(e){if(!(e.schema??e.ajvOptions??e.rootSchema))return;if(e.schema&&typeof e.schema!=`object`)throw TypeError("The `schema` option must be an object.");let t=qS.default.default,n=new KS.Ajv2020({allErrors:!0,useDefaults:!0,...e.ajvOptions});t(n);let r={...e.rootSchema,type:`object`,properties:e.schema};this.#e=n.compile(r),this.#d(e.schema)}#d(e){let t=Object.entries(e??{});for(let[e,n]of t){if(!n||typeof n!=`object`||!Object.hasOwn(n,`default`))continue;let{default:t}=n;t!==void 0&&(this.#i[e]=t)}}#f(e){e.defaults&&Object.assign(this.#i,e.defaults)}#p(e){e.serialize&&(this._serialize=e.serialize),e.deserialize&&(this._deserialize=e.deserialize)}#m(e){let t=typeof e.fileExtension==`string`?e.fileExtension:void 0,n=t?`.${t}`:``;return I.resolve(e.cwd,`${e.configName??`config`}${n}`)}#h(e){if(e.migrations){this.#g(e),this._validate(this.store);return}let t=this.store,n=Object.assign(ZS(),e.defaults??{},t);this._validate(n);try{Ie.deepEqual(t,n)}catch{this.store=n}}#g(e){let{migrations:t,projectVersion:n}=e;if(t){if(!n)throw Error("Please specify the `projectVersion` option.");this.#a=!0;try{let r=this.store,i=Object.assign(ZS(),e.defaults??{},r);try{Ie.deepEqual(r,i)}catch{this._write(i)}this._migrate(t,n,e.beforeEachMigration)}finally{this.#a=!1}}}};function rC(){return new nC({projectName:`jsrepo-v2`})}var iC=class{#e;constructor(e){this.#e=e??rC()}get(e,t){if(e.auth?.tokenStoredFor===`registry`){let n=this.getProviderRegistryTokens(e);if(!t)throw new D(`No registry was provided to get when one was expected`,{suggestion:`This is a bug in jsrepo. Please report it here https://github.com/jsrepo/jsrepo/issues`});return n[t]}else{let t=this.#e.get(e.name,void 0);return e.auth?.envVar?t??process.env[e.auth.envVar]:t}}set(e,t,n){if(e.auth?.tokenStoredFor===`registry`){if(!t)throw new D(`No registry was provided to set when one was expected`,{suggestion:`This is a bug in jsrepo. Please report it here https://github.com/jsrepo/jsrepo/issues`});this.setProviderRegistryToken(e,t,n)}else this.#e.set(e.name,n)}delete(e,t){if(e.auth?.tokenStoredFor===`registry`){let n=this.getProviderRegistryTokens(e);if(!t)throw new D(`No registry was provided to delete when one was expected`,{suggestion:`This is a bug in jsrepo. Please report it here https://github.com/jsrepo/jsrepo/issues`});delete n[t],this.#e.set(e.name,n)}else this.#e.delete(e.name)}getProviderRegistryTokens(e){return this.#e.get(e.name)??{}}setProviderRegistryToken(e,t,n){let r=this.getProviderRegistryTokens(e);r[t]=n,this.#e.set(e.name,r)}};async function aC(e,{cwd:t,providers:n}){if(e.length===0)return(0,U.ok)(new Map);let r=new iC,i=await Promise.all(e.map(async e=>{let i=n.find(t=>t?.matches(e));if(!i)return(0,U.err)(new fe(e));let a=r.get(i,e),o=await i?.create(e,{cwd:t,token:a}),s=await ew(o,{token:a});return s.isErr()?(0,U.err)(s.error):(0,U.ok)({url:e,provider:o,manifest:s.value,token:a})})),a=new Map;for(let e of i){if(e.isErr())return(0,U.err)(e.error);a.set(e.value.url,e.value)}return(0,U.ok)(a)}function oC(e,{providers:t,registries:n}){let r=e.map(e=>{if(t.some(t=>t.matches(e))){let t=e.lastIndexOf(`/`);return{registryUrl:e.substring(0,t),itemName:e.substring(t+1)}}return{itemName:e}}),i=r.every(e=>e.registryUrl),a=r.every(e=>e.registryUrl===void 0),o=r.filter(e=>e.registryUrl!==void 0).map(e=>e.registryUrl);return a&&n.length===0?(0,U.err)(new pe):(0,U.ok)({wantedItems:r,neededRegistries:[...o,...i?[]:n]})}async function sC(e,{resolvedRegistries:t,nonInteractive:n}){let r=[];for(let i of e){let e,s;if(i.registryUrl){e=t.get(i.registryUrl);let n=e.manifest.items.find(e=>e.name===i.itemName);if(!n)return(0,U.err)(new E(i.itemName,e.url));s={...n,add:n.add??`when-added`}}else{let r=new Map;for(let[e,n]of t.entries()){let t=n.manifest.items.find(e=>e.name===i.itemName);t&&r.set(e,{registry:n,item:t})}if(r.size===0)return(0,U.err)(new E(i.itemName));if(r.size>1){if(n)return(0,U.err)(new x(i.itemName,Array.from(r.keys())));let t=await o({message:`Multiple registries contain ${Gu.default.cyan(i.itemName)}. Please select one:`,options:Array.from(r.entries()).map(([e])=>({label:i.itemName,value:e,hint:e}))});a(t)&&(_(`Canceled!`),process.exit(0));let{registry:c,item:l}=r.get(t);e=c,s=l}else{let{registry:t,item:n}=r.values().next().value;e=t,s=n}}r.push({registry:e,item:s})}return(0,U.ok)(r)}async function cC(e){try{return sc(By,await e.registry.provider.fetch(`${e.name}.json`,{token:e.registry.token}))}catch(t){return(0,U.err)(new ee(t,{registry:e.registry.url,item:e.name}))}}async function lC(e,t){try{return(0,U.ok)(await t.registry.provider.fetch(e,{token:t.registry.token}))}catch(n){return n instanceof S?(0,U.err)(new w(n.originalMessage,{registry:t.registry.url,item:t.name,resourcePath:n.resourcePath})):(0,U.err)(new w(n instanceof Error?n.message:String(n),{registry:t.registry.url,item:t.name,resourcePath:e}))}}async function uC(e){let t=await Promise.all(e.files.map(async t=>{let n=await lC(t.relativePath,e);return n.isErr()?(0,U.err)(n.error):(0,U.ok)({...t,content:n.value})})),n=[];for(let e of t){if(e.isErr())return(0,U.err)(e.error);n.push(e.value)}return(0,U.ok)({name:e.name,type:e.type,add:e.add,description:e.description,dependencies:e.dependencies,devDependencies:e.devDependencies,registry:e.registry,files:n,envVars:e.envVars,categories:e.categories,meta:e.meta})}async function dC(e){let t=await cC(e);return t.isErr()?(0,U.err)(t.error):(0,U.ok)({...t.value,files:t.value.files.map(e=>({...e,path:t.value.$schema===`https://ui.shadcn.com/schema/registry-item.json`?L.basename(e.path):e.path})),registry:e.registry})}async function fC(e){let t=await Promise.all(e.map(async e=>e.registry.manifest.type===`repository`?await uC(e):await dC(e))),n=[];for(let e of t){if(e.isErr())return(0,U.err)(e.error);n.push(e.value)}return(0,U.ok)(n)}async function pC(e,{paths:t,nonInteractive:n,options:r,matcher:i}){if(e.files.filter(e=>e.target!==void 0).length===e.files.length)return(0,U.ok)({path:``,resolvedPath:``});let o=t[`*`],s=SC(e.type),l=t[s];if(!l){if(o)return(0,U.ok)({path:o,resolvedPath:o});if(n)return(0,U.err)(new T({item:e.name,type:s}));let t=e.registry.manifest.defaultPaths?.[s]??`./src/${s}`,l=await c({message:`Where would you like to add ${Gu.default.cyan(s)}?`,placeholder:t,initialValue:t,defaultValue:t,validate(e){if(!e||e.trim()===``)return`Please provide a value`}});return a(l)&&(_(`Canceled!`),process.exit(0)),(0,U.ok)({path:l,resolvedPath:b_(l,{cwd:r.cwd,matcher:i})})}return(0,U.ok)({path:l,resolvedPath:l})}async function mC(e,{item:t,options:n,config:r}){for(let i of r?.transforms??[]){let r=await i.transform({code:e.content,fileName:e.path,options:{cwd:n.cwd,registryUrl:t.registry.url,item:t}});e.content=r.code??e.content,e.path=r.fileName??e.path}return e}function hC(e,{itemPath:t,options:n}){return e.target?Wc(n.cwd,e.target):Wc(n.cwd,t.path,e.path)}async function gC(e,t){let n=_C(e,{resolvedItems:new Map,options:t??{}});if(n.isErr())return(0,U.err)(n.error);let r=n.value,i=await fC(r);if(i.isErr())return(0,U.err)(i.error);let a=i.value;return(0,U.ok)(a)}function _C(e,{resolvedItems:t,options:n}){for(let r of e){if(t.has(r.item.name))continue;let e=[];for(let n of r.item.registryDependencies??[]){if(t.has(n))continue;let i=r.registry.manifest.items.find(e=>e.name===n);if(!i)return(0,U.err)(new E(n,r.registry.url));e.push({registry:r.registry,item:i})}for(let i of r.item.files)if(dy(i.role,n.withRoles??new Set))for(let n of i.registryDependencies??[]){if(t.has(n))continue;let i=r.registry.manifest.items.find(e=>e.name===n);if(!i)return(0,U.err)(new E(n,r.registry.url));e.push({registry:r.registry,item:i})}t.set(r.item.name,{name:r.item.name,type:r.item.type,description:r.item.description,add:r.item.add,registryDependencies:r.item.registryDependencies,dependencies:r.item.dependencies,devDependencies:r.item.devDependencies,registry:r.registry,files:r.item.files,envVars:r.item.envVars,categories:r.item.categories,meta:r.item.meta});let i=_C(e,{resolvedItems:t,options:n});if(i.isErr())return(0,U.err)(i.error);for(let e of i.value)t.set(e.name,e)}return(0,U.ok)(Array.from(t.values()))}async function vC({items:e,config:t,options:n,continueOnNoPath:r=!1}){let i=v_({cwd:n.cwd}),a=y_(t?.paths??{},{cwd:n.cwd,matcher:i}),o={};for(let s of e){let e=Array.from(new Set(Array.from(s.files,e=>SC(e.type))));for(let c of e){let e=a[`${c}/${s.name}`],l=a[c];if(e!==void 0){a[`${c}/${s.name}`]=e;continue}if(l!==void 0){a[c]=l;continue}let u=await pC(s,{paths:a,nonInteractive:n.yes,options:n,matcher:i});if(u.isErr()){if(u.error instanceof T&&r)continue;return(0,U.err)(u.error)}let{path:d,resolvedPath:f}=u.value;a[c]=f,o[c]=d,t&&(t.paths[c]=d)}}return(0,U.ok)({itemPaths:yC(e,a,{config:t}),resolvedPaths:a,updatedPaths:o})}function yC(e,t,{config:n}){let r=e.reduce((e,r)=>{for(let i of r.files){let a=SC(i.type),o=t[`${a}/${r.name}`],s=n?.paths[`${a}/${r.name}`]&&n.paths[`${a}/${r.name}`]!==o?n.paths[`${a}/${r.name}`]:void 0,c=t[a],l=n?.paths[a]&&n.paths[a]!==c?n.paths[a]:void 0;e[`${a}/${r.name}`]=o?{path:o,alias:s}:{path:c,alias:l}}return e},{});for(let[e,i]of Object.entries(t)){if(e.includes(`/`))continue;let t=e,a=i,o=n?.paths[t]&&n.paths[t]!==a?n.paths[t]:void 0;a&&(r[t]={path:a,alias:o})}return r}async function bC({items:e,itemPaths:t,configResult:n,options:r}){let i=[],a=new Map,o=new Map,s;for(let c of e){for(let e of c.files){if(!dy(e.role,r.withRoles??new Set))continue;let s=t[`${SC(e.type)}/${c.name}`],l=e.path;e=await mC(e,{item:c,languages:n?.config.languages??c_,options:r,config:n?.config,itemPaths:t});for(let t of e.dependencies??[])a.set(`${t.ecosystem}:${t.name}@${t.version}`,t);for(let t of e.devDependencies??[])o.set(`${t.ecosystem}:${t.name}@${t.version}`,t);let u=hC(e,{itemPath:s,options:r});if(el(u)){let t=Yc(u)._unsafeUnwrap();i.push({type:`update`,fileType:e.type,oldContent:t,_imports_:e._imports_??[],filePath:u,newPath:e.path,originalPath:l,content:e.content,itemName:c.name,registryUrl:c.registry.url})}else i.push({type:`create`,fileType:e.type,_imports_:e._imports_??[],filePath:u,newPath:e.path,originalPath:l,content:e.content,itemName:c.name,registryUrl:c.registry.url})}for(let e of c.dependencies??[])if(typeof e==`string`){let t=tu(e);if(t.isErr())return(0,U.err)(new ce({dependency:e,registryName:c.registry.url,itemName:c.name}));let n=t.value;a.set(`js:${n.name}@${n.version}`,{ecosystem:`js`,name:n.name,version:n.version})}else a.set(`${e.ecosystem}:${e.name}@${e.version}`,e);for(let e of c.devDependencies??[])if(typeof e==`string`){let t=tu(e);if(t.isErr())return(0,U.err)(new ce({dependency:e,registryName:c.registry.url,itemName:c.name}));let n=t.value;o.set(`js:${n.name}@${n.version}`,{ecosystem:`js`,name:n.name,version:n.version})}else o.set(`${e.ecosystem}:${e.name}@${e.version}`,e);for(let[e,t]of Object.entries(c.envVars??{}))s===void 0&&(s={}),s[e]=t}for(let e of i){let a=[];for(let t of e._imports_??[]){let e=i.find(e=>e.originalPath===t.file.path&&t.item===e.itemName&&e.fileType===t.file.type);if(!e){a.push(t);continue}a.push({import:t.import,item:t.item,file:{type:t.file.type,path:e.newPath},meta:t.meta})}e.content=await(n?.config.languages.find(t=>t.canResolveDependencies(e.newPath)))?.transformImports(e.content,a,{cwd:r.cwd,targetPath:e.newPath,item:e.itemName,file:{type:e.fileType,path:e.newPath},getItemPath:({item:e,file:n})=>{let r=SC(n.type);for(let[n,i]of Object.entries(t))if(n===`${r}/${e}`||n===r)return i;throw new k}})??e.content}return(0,U.ok)({neededDependencies:{dependencies:Array.from(a.values()),devDependencies:Array.from(o.values())},neededEnvVars:s,neededFiles:i.filter(e=>`oldContent`in e?e.oldContent!==e.content:!0)})}async function xC({files:e,options:t}){let n=[];for(let r of e)if(r.type===`create`||t.overwrite){let e=Xc(r.filePath,r.content);if(e.isErr())return(0,U.err)(e.error);n.push(L.relative(t.cwd,r.filePath))}else{let e=R_(r.oldContent,r.content),i=L.relative(t.cwd,r.filePath),s=qy({from:`${r.registryUrl}/${r.itemName}`,to:i,changes:e,expand:t.expand,maxUnchanged:t.maxUnchanged,prefix:()=>`${rd} `,onUnchanged:({from:e,to:t,prefix:n})=>`${n?.()??``}${Gu.default.cyan(e)} → ${Gu.default.gray(t)} ${Gu.default.gray(`(unchanged)`)}\n`,intro:({from:e,to:t,changes:n,prefix:r})=>{let i=n.filter(e=>e.added||e.removed).length;return`${r?.()??``}${Gu.default.cyan(e)} → ${Gu.default.gray(t)} (${i} change${i===1?``:`s`})\n${r?.()??``}\n`}});if(s.type===`unchanged`)continue;process.stdout.write(`${rd}\n`),process.stdout.write(s.diff);let c=await o({message:`Would you like to apply these changes?`,options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}],initialValue:`yes`});if(a(c)&&(_(`Canceled!`),process.exit(0)),c===`no`)continue;let l=Xc(r.filePath,r.content);if(l.isErr())return(0,U.err)(l.error);n.push(L.relative(t.cwd,r.filePath))}return(0,U.ok)(n)}function SC(e){return e.startsWith(`registry:`)?e.slice(9):e}function CC({format:e}={}){return{output:async(t,{cwd:n})=>{let r={name:t.name,authors:t.authors,bugs:t.bugs,description:t.description,homepage:t.homepage,repository:t.repository,tags:t.tags,version:t.version,meta:t.meta,type:`repository`,plugins:t.plugins,defaultPaths:t.defaultPaths,items:t.items.map(e=>({name:e.name,title:e.title,description:e.description,type:e.type,add:e.add,registryDependencies:e.registryDependencies,dependencies:e.dependencies,devDependencies:e.devDependencies,files:e.files.map(e=>({type:e.type,role:e.role,path:e.path,relativePath:Jc(n,e.absolutePath),_imports_:e._imports_,target:e.target,registryDependencies:e.registryDependencies,dependencies:e.dependencies,devDependencies:e.devDependencies})),envVars:e.envVars,categories:e.categories,meta:e.meta}))};Xc(Wc(n,vy),Py(r,{format:e}))},clean:async({cwd:e})=>{$c(Wc(e,vy))}}}const wC=vs({path:B().transform(e=>e),type:B(),role:B().optional(),relativePath:B().transform(e=>e),_imports_:gs(yy),target:H([B(),V()]),registryDependencies:H([gs(B()),V()]),dependencies:H([gs(H_),V()]),devDependencies:H([gs(H_),V()])}),TC=vs({name:B(),title:H([B(),V()]),description:H([B(),V()]),type:B(),registryDependencies:H([gs(B()),V()]),add:H([u_,V()]),files:H([gs(wC),V()]).default([]),dependencies:H([gs(H([H_,B()])),V()]),devDependencies:H([gs(H([H_,B()])),V()]),envVars:H([Ts(B(),B()),V()]),categories:H([gs(B()),V()]),meta:H([Ts(B(),B()),V()])}),EC=xs(`type`,[Ry,l_.extend({type:ks(`repository`),plugins:H([W_,V()]),items:gs(TC),defaultPaths:H([Ts(B(),B()),V()])})]),DC=`https://dev.azure.com`;function OC(e={}){return{name:`azure`,matches:e=>e.startsWith(DC)||e.startsWith(`azure/`)||e.startsWith(`azure:`),create:(t,n)=>kC.create(t,e,n),auth:{tokenStoredFor:`provider`,envVar:`AZURE_TOKEN`}}}var kC=class e{constructor(e,t){this.state=e,this.opts=t}static async create(t,n,r){return new e(await e.getState(t,n,r),n)}async fetch(t,{token:n,fetch:r=fetch}){let i=this.resolveRaw(t);try{let t={...e.authHeader(n)??{}},a=await r(i.toString(),{headers:t});if(!a.ok)throw a.headers.get(`content-type`)?.includes(`application/json`)?new S(`${a.status} ${(await a.json()).message??a.statusText}`,i.toString()):new S(`${a.status} ${a.statusText}`,i.toString());return await a.text()}catch(e){throw e instanceof S?new S(e.originalMessage,i.toString()):new S(`${e instanceof Error?e.message:String(e)}`,i.toString())}}static async getState(t,n,r){return e.parseUrl(t,n)}static parseUrl(e,t){let n=t.baseUrl??DC;e.startsWith(`azure:`)?n=new URL(e.slice(6)).origin:e.startsWith(DC)&&(n=DC);let[r,i,a,...o]=e.replaceAll(/(azure\/)|(azure:https?:\/\/[^/]+\/)/g,``).split(`/`),s=`main`,c=`heads`;return o[0]&&[`tags`,`heads`].includes(o[0])&&(c=o[0],o[1]&&o[1]!==``&&(s=o[1])),{baseUrl:n,owner:r,repoName:a,project:i,ref:s,refs:c}}resolveRaw(e){let{owner:t,repoName:n,project:r,ref:i,refs:a,baseUrl:o}=this.state,s=a===`tags`?`tag`:`branch`;return new URL(`${o}/${t}/${r}/_apis/git/repositories/${n}/items?path=${e}&api-version=7.2-preview.1&versionDescriptor.version=${i}&versionDescriptor.versionType=${s}`)}static authHeader(e){if(e)return{Authorization:`Bearer ${e}`}}};const AC=`https://bitbucket.org`,jC=`main`;function MC(e={}){return{name:`bitbucket`,matches:e=>e.startsWith(AC)||e.startsWith(`bitbucket/`)||e.startsWith(`bitbucket:`),create:(t,n)=>NC.create(t,e,n),auth:{tokenStoredFor:`provider`,envVar:`BITBUCKET_TOKEN`}}}var NC=class e{constructor(e,t){this.state=e,this.opts=t}static async create(t,n,r){return new e(await e.getState(t,n,r),n)}async fetch(t,{token:n,fetch:r=fetch}){let i=this.resolveRaw(t);try{let t={...e.authHeader(n)??{}},a=await r(i.toString(),{headers:t});if(!a.ok)throw a.headers.get(`content-type`)?.includes(`application/json`)?new S(`${a.status} ${(await a.json()).message??a.statusText}`,i.toString()):new S(`${a.status} ${a.statusText}`,i.toString());return await a.text()}catch(e){throw e instanceof S?new S(e.originalMessage,i.toString()):new S(`${e instanceof Error?e.message:String(e)}`,i.toString())}}static async getState(t,n,{token:r,fetch:i=fetch}){let a=e.parseUrl(t,n),{owner:o,repoName:s,ref:c,baseUrl:l}=a;if(c===void 0)try{let t=e.getApiUrl(a.baseUrl),n=await i(new URL(`/repositories/${o}/${s}`,t).toString(),{headers:e.authHeader(r)});c=n.ok?(await n.json()).mainbranch.name:jC}catch{c=jC}return{owner:o,ref:c,repoName:s,baseUrl:l}}static parseUrl(e,t){let n=t.baseUrl??AC;e.startsWith(`bitbucket:`)?n=new URL(e.slice(10)).origin:e.startsWith(AC)&&(n=AC);let[r,i,...a]=e.replaceAll(/(https:\/\/bitbucket.org\/)|(bitbucket\/)|(bitbucket:https?:\/\/[^/]+\/)/g,``).split(`/`),o;return a[0]===`src`&&(o=a[1]),{baseUrl:n,owner:r,repoName:i,ref:o}}static getApiUrl(e){let t=new URL(e??AC);return`${t.protocol}//api.${t.host}/2.0`}resolveRaw(t){let{owner:n,repoName:r,ref:i,baseUrl:a}=this.state;return new URL(`repositories/${n}/${r}/src/${i}/${t}`,`${e.getApiUrl(a)}/`)}static authHeader(e){if(e)return{Authorization:`Bearer ${e}`}}};function PC(e={}){return{name:`Fs`,matches:e=>e.startsWith(`fs://`),create:(t,n)=>FC.create(t,e,n)}}var FC=class e{constructor(e,t){this.state=e,this.opts=t}async fetch(e){let t=Wc(this.state.path,e);try{return Yc(t)._unsafeUnwrap()}catch(e){let n=L.isAbsolute(t)?t:L.join(process.cwd(),t);throw e instanceof S?new S(e.originalMessage,n):new S(`${e instanceof Error?e.message:String(e)}`,n)}}static async create(t,n,r){let i=t.slice(5),a;return a=n.baseDir?n.baseDir.startsWith(`.`)?Wc(r.cwd,n.baseDir,i):Wc(n.baseDir,i):i.startsWith(`.`)?Wc(r.cwd,i):i,new e({path:a},n)}};const IC=`https://github.com`,LC=`main`;function RC(e={}){return{name:`github`,matches:t=>t.startsWith(e.baseUrl??IC)||t.startsWith(`github/`)||t.startsWith(`github:`),create:(t,n)=>zC.create(t,e,n),auth:{tokenStoredFor:`provider`,envVar:`GITHUB_TOKEN`}}}var zC=class e{constructor(e,t){this.state=e,this.opts=t}static async create(t,n,r){return new e(await e.getState(t,n,r),n)}async fetch(t,{token:n,fetch:r=fetch}){let i=this.resolveRaw(t);try{let t={...e.authHeader(n)??{},Accept:`application/vnd.github.raw+json`},a=await r(i.toString(),{headers:t});if(!a.ok)throw a.headers.get(`content-type`)?.includes(`application/json`)?new S(`${a.status} ${(await a.json()).message??a.statusText}`,i.toString()):new S(`${a.status} ${a.statusText}`,i.toString());return await a.text()}catch(e){throw e instanceof S?new S(e.originalMessage,i.toString()):new S(`${e instanceof Error?e.message:String(e)}`,i.toString())}}static async getState(t,n,{token:r,fetch:i=fetch}){let{owner:a,repoName:o,ref:s}=e.parseUrl(t,n);if(s===void 0)try{let t=e.getApiUrl(n.baseUrl??IC),c=await i(new URL(`/repos/${a}/${o}`,t).toString(),{headers:e.authHeader(r)});s=c.ok?(await c.json()).default_branch:LC}catch{s=LC}return{owner:a,ref:s,repoName:o,url:t,baseUrl:n.baseUrl??IC}}static parseUrl(e,t){let n=t.baseUrl??IC;e.startsWith(`github:`)?n=new URL(e.slice(7)).origin:e.startsWith(IC)&&(n=IC);let[r,i,...a]=e.replaceAll(/github\/|https:\/\/github\.com\/|github:https?:\/\/[^/]+\//g,``).split(`/`),o;if(a.length>0&&a[0]===`tree`&&a[1]&&(o=a[1]),!r||!i)throw Error(`Failed to parse invalid URL: ${e}`);return{baseUrl:n,owner:r,repoName:i,ref:o}}resolveRaw(t){let{owner:n,repoName:r,ref:i,baseUrl:a}=this.state;return new URL(`${t}?ref=${i}`,`${e.getApiUrl(a)}/repos/${n}/${r}/contents/`)}static getApiUrl(e){let t=new URL(e??IC);return`${t.protocol}//api.${t.host}`}static authHeader(e){if(e)return{Authorization:`Bearer ${e}`}}};const BC=`https://gitlab.com`,VC=`main`;function HC(e={}){return{name:`gitlab`,matches:t=>t.startsWith(e.baseUrl??BC)||t.startsWith(`gitlab/`)||t.startsWith(`gitlab:`),create:(t,n)=>UC.create(t,e,n),auth:{tokenStoredFor:`provider`,envVar:`GITLAB_TOKEN`}}}var UC=class e{constructor(e,t){this.state=e,this.opts=t}static async create(t,n,r){return new e(await e.getState(t,n,r),n)}async fetch(t,{token:n,fetch:r=fetch}){let i=this.resolveRaw(t);try{let t={...e.authHeader(n)??{}},a=await r(i.toString(),{headers:t});if(!a.ok)throw a.headers.get(`content-type`)?.includes(`application/json`)?new S(`${a.status} ${(await a.json()).message??a.statusText}`,i.toString()):new S(`${a.status} ${a.statusText}`,i.toString());return await a.text()}catch(e){throw e instanceof S?new S(e.originalMessage,i.toString()):new S(`${e instanceof Error?e.message:String(e)}`,i.toString())}}static async getState(t,n,{token:r,fetch:i=fetch}){let a=e.parseUrl(t,n),{id:o,ref:s}=a;if(s===void 0)try{let t=e.getApiUrl(a.baseUrl),n=await i(new URL(`/projects/${encodeURIComponent(o)}`,t).toString(),{headers:e.authHeader(r)});s=n.ok?(await n.json()).default_branch:VC}catch{s=VC}return{id:o,ref:s,url:t,baseUrl:n.baseUrl??BC}}static parseUrl(e,t){let n=t.baseUrl??BC;e.startsWith(`gitlab:`)?n=new URL(e.slice(7)).origin:e.startsWith(BC)&&(n=BC);let r=e.replaceAll(/gitlab\/|https:\/\/gitlab\.com\/|gitlab:https?:\/\/[^/]+\//g,``),i=r,a=r.indexOf(`/-/tree/`),o;if(a!==-1){o=r.slice(a+8);let e=o.indexOf(`?`);e!==-1&&(o=o.slice(0,e)),i=i.slice(0,a)}return{baseUrl:n,id:i,ref:o,url:e}}static getApiUrl(e){let t=new URL(e??BC);return`${t.protocol}//${t.host}/api/v4`}resolveRaw(t){let{id:n,ref:r,baseUrl:i}=this.state;return new URL(`projects/${encodeURIComponent(n)}/repository/files/${encodeURIComponent(t)}/raw?ref=${r}`,`${e.getApiUrl(i)}/`)}static authHeader(e){if(e)return{"PRIVATE-TOKEN":e}}};function WC(e){let t=e;return t.endsWith(`/`)||(t=`${t}/`),t}function GC(e={}){return{name:`http`,matches:t=>e.baseUrl?t.startsWith(e.baseUrl):t.startsWith(`http`),create:t=>KC.create(t,e),auth:{tokenStoredFor:`registry`}}}var KC=class e{constructor(e,t){this.state=e,this.opts=t}async fetch(e,{token:t,fetch:n=fetch}){let r=this.resolveRaw(e);try{let e={...this.opts.headers??{},...this.authHeader(t)??{}},i=await n(r.toString(),{headers:e});if(!i.ok)throw i.headers.get(`content-type`)?.includes(`application/json`)?new S(`${i.status} ${(await i.json()).message??i.statusText}`,r.toString()):new S(`${i.status} ${i.statusText}`,r.toString());return await i.text()}catch(e){throw e instanceof S?new S(e.originalMessage,r.toString()):new S(`${e instanceof Error?e.message:String(e)}`,r.toString())}}resolveRaw(e){return new URL(e,WC(this.state.url))}authHeader(e){if(e)return this.opts.authHeader?this.opts.authHeader(e):{Authorization:`Bearer ${e}`}}static async create(t,n){return new e({url:t},n)}},qC=e(t(((e,t)=>{(function(r,i){typeof e==`object`&&typeof t==`object`?t.exports=i(n(`child_process`),n(`crypto`)):typeof define==`function`&&define.amd?define([`child_process`,`crypto`],i):typeof e==`object`?e[`electron-machine-id`]=i(n(`child_process`),n(`crypto`)):r[`electron-machine-id`]=i(r.child_process,r.crypto)})(e,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p=``,t(0)}([function(e,t,n){e.exports=n(34)},function(e,t,n){var r=n(29)(`wks`),i=n(33),a=n(2).Symbol,o=typeof a==`function`,s=e.exports=function(e){return r[e]||(r[e]=o&&a[e]||(o?a:i)(`Symbol.`+e))};s.store=r},function(e,t){var n=e.exports=typeof window<`u`&&window.Math==Math?window:typeof self<`u`&&self.Math==Math?self:Function(`return this`)();typeof __g==`number`&&(__g=n)},function(e,t,n){var r=n(9);e.exports=function(e){if(!r(e))throw TypeError(e+` is not an object!`);return e}},function(e,t,n){e.exports=!n(24)(function(){return Object.defineProperty({},`a`,{get:function(){return 7}}).a!=7})},function(e,t,n){var r=n(12),i=n(17);e.exports=n(4)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){var n=e.exports={version:`2.4.0`};typeof __e==`number`&&(__e=n)},function(e,t,n){var r=n(14);e.exports=function(e,t,n){if(r(e),t===void 0)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){return typeof e==`object`?e!==null:typeof e==`function`}},function(e,t){e.exports={}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(3),i=n(26),a=n(32),o=Object.defineProperty;t.f=n(4)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return o(e,t,n)}catch{}if(`get`in n||`set`in n)throw TypeError(`Accessors not supported!`);return`value`in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(42),i=n(15);e.exports=function(e){return r(i(e))}},function(e,t){e.exports=function(e){if(typeof e!=`function`)throw TypeError(e+` is not a function!`);return e}},function(e,t){e.exports=function(e){if(e==null)throw TypeError(`Can't call method on `+e);return e}},function(e,t,n){var r=n(9),i=n(2).document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(12).f,i=n(8),a=n(1)(`toStringTag`);e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},function(e,t,n){var r=n(29)(`keys`),i=n(33);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(11),i=n(1)(`toStringTag`),a=r(function(){return arguments}())==`Arguments`,o=function(e,t){try{return e[t]}catch{}};e.exports=function(e){var t,n,s;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=o(t=Object(e),i))==`string`?n:a?r(t):(s=r(t))==`Object`&&typeof t.callee==`function`?`Arguments`:s}},function(e,t){e.exports=`constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf`.split(`,`)},function(e,t,n){var r=n(2),i=n(6),a=n(7),o=n(5),s=`prototype`,c=function(e,t,n){var l,u,d,f=e&c.F,p=e&c.G,m=e&c.S,h=e&c.P,g=e&c.B,_=e&c.W,v=p?i:i[t]||(i[t]={}),y=v[s],b=p?r:m?r[t]:(r[t]||{})[s];for(l in p&&(n=t),n)u=!f&&b&&b[l]!==void 0,u&&l in v||(d=u?b[l]:n[l],v[l]=p&&typeof b[l]!=`function`?n[l]:g&&u?a(d,r):_&&b[l]==d?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[s]=e[s],t}(d):h&&typeof d==`function`?a(Function.call,d):d,h&&((v.virtual||={})[l]=d,e&c.R&&y&&!y[l]&&o(y,l,d)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t){e.exports=function(e){try{return!!e()}catch{return!0}}},function(e,t,n){e.exports=n(2).document&&document.documentElement},function(e,t,n){e.exports=!n(4)&&!n(24)(function(){return Object.defineProperty(n(16)(`div`),`a`,{get:function(){return 7}}).a!=7})},function(e,t,n){var r=n(28),i=n(23),a=n(57),o=n(5),s=n(8),c=n(10),l=n(45),u=n(18),d=n(52),f=n(1)(`iterator`),p=!([].keys&&`next`in[].keys()),m=`@@iterator`,h=`keys`,g=`values`,_=function(){return this};e.exports=function(e,t,n,v,y,b,x){l(n,t,v);var S,C,w,ee=function(e){if(!p&&e in O)return O[e];switch(e){case h:return function(){return new n(this,e)};case g:return function(){return new n(this,e)}}return function(){return new n(this,e)}},T=t+` Iterator`,E=y==g,D=!1,O=e.prototype,k=O[f]||O[m]||y&&O[y],te=k||ee(y),ne=y?E?ee(`entries`):te:void 0,re=t==`Array`&&O.entries||k;if(re&&(w=d(re.call(new e)),w!==Object.prototype&&(u(w,T,!0),r||s(w,f)||o(w,f,_))),E&&k&&k.name!==g&&(D=!0,te=function(){return k.call(this)}),r&&!x||!p&&!D&&O[f]||o(O,f,te),c[t]=te,c[T]=_,y)if(S={values:E?te:ee(g),keys:b?te:ee(h),entries:ne},x)for(C in S)C in O||a(O,C,S[C]);else i(i.P+i.F*(p||D),t,S);return S}},function(e,t){e.exports=!0},function(e,t,n){var r=n(2),i=`__core-js_shared__`,a=r[i]||(r[i]={});e.exports=function(e){return a[e]||(a[e]={})}},function(e,t,n){var r,i,a,o=n(7),s=n(41),c=n(25),l=n(16),u=n(2),d=u.process,f=u.setImmediate,p=u.clearImmediate,m=u.MessageChannel,h=0,g={},_=`onreadystatechange`,v=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},y=function(e){v.call(e.data)};f&&p||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++h]=function(){s(typeof e==`function`?e:Function(e),t)},r(h),h},p=function(e){delete g[e]},n(11)(d)==`process`?r=function(e){d.nextTick(o(v,e,1))}:m?(i=new m,a=i.port2,i.port1.onmessage=y,r=o(a.postMessage,a,1)):u.addEventListener&&typeof postMessage==`function`&&!u.importScripts?(r=function(e){u.postMessage(e+``,`*`)},u.addEventListener(`message`,y,!1)):r=_ in l(`script`)?function(e){c.appendChild(l(`script`))[_]=function(){c.removeChild(this),v.call(e)}}:function(e){setTimeout(o(v,e,1),0)}),e.exports={set:f,clear:p}},function(e,t,n){var r=n(20),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(9);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e))||typeof(n=e.valueOf)==`function`&&!r(i=n.call(e))||!t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e)))return i;throw TypeError(`Can't convert object to primitive value`)}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return`Symbol(${e===void 0?``:e})_${(++n+r).toString(36)}`}},function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function i(){return process.platform===`win32`?process.arch===`ia32`&&process.env.hasOwnProperty(`PROCESSOR_ARCHITEW6432`)?`mixed`:`native`:``}function a(e){return(0,d.createHash)(`sha256`).update(e).digest(`hex`)}function o(e){switch(f){case`darwin`:return e.split(`IOPlatformUUID`)[1].split(`
|
|
84
84
|
`)[0].replace(/\=|\s+|\"/gi,``).toLowerCase();case`win32`:return e.toString().split(`REG_SZ`)[1].replace(/\r+|\n+|\s+/gi,``).toLowerCase();case`linux`:return e.toString().replace(/\r+|\n+|\s+/gi,``).toLowerCase();case`freebsd`:return e.toString().replace(/\r+|\n+|\s+/gi,``).toLowerCase();default:throw Error(`Unsupported platform: `+process.platform)}}function s(e){var t=o((0,u.execSync)(p[f]).toString());return e?t:a(t)}function c(e){return new l.default(function(t,n){return(0,u.exec)(p[f],{},function(r,i,s){if(r)return n(Error(`Error while obtaining machine id: `+r.stack));var c=o(i.toString());return t(e?c:a(c))})})}Object.defineProperty(t,`__esModule`,{value:!0});var l=r(n(35));t.machineIdSync=s,t.machineId=c;var u=n(70),d=n(71),f=process.platform,p={darwin:`ioreg -rd1 -c IOPlatformExpertDevice`,win32:{native:`%windir%\\System32`,mixed:`%windir%\\sysnative\\cmd.exe /c %windir%\\System32`}[i()]+`\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`,linux:`( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :`,freebsd:`kenv -q smbios.system.uuid || sysctl -n kern.hostuuid`}},function(e,t,n){e.exports={default:n(36),__esModule:!0}},function(e,t,n){n(66),n(68),n(69),n(67),e.exports=n(6).Promise},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||r!==void 0&&r in e)throw TypeError(n+`: incorrect invocation!`);return e}},function(e,t,n){var r=n(13),i=n(31),a=n(62);e.exports=function(e){return function(t,n,o){var s,c=r(t),l=i(c.length),u=a(o,l);if(e&&n!=n){for(;l>u;)if(s=c[u++],s!=s)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===n)return e||u||0;return!e&&-1}}},function(e,t,n){var r=n(7),i=n(44),a=n(43),o=n(3),s=n(31),c=n(64),l={},u={},t=e.exports=function(e,t,n,d,f){var p,m,h,g,_=f?function(){return e}:c(e),v=r(n,d,t?2:1),y=0;if(typeof _!=`function`)throw TypeError(e+` is not iterable!`);if(a(_)){for(p=s(e.length);p>y;y++)if(g=t?v(o(m=e[y])[0],m[1]):v(e[y]),g===l||g===u)return g}else for(h=_.call(e);!(m=h.next()).done;)if(g=i(h,v,m.value,t),g===l||g===u)return g};t.BREAK=l,t.RETURN=u},function(e,t){e.exports=function(e,t,n){var r=n===void 0;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(11);e.exports=Object(`z`).propertyIsEnumerable(0)?Object:function(e){return r(e)==`String`?e.split(``):Object(e)}},function(e,t,n){var r=n(10),i=n(1)(`iterator`),a=Array.prototype;e.exports=function(e){return e!==void 0&&(r.Array===e||a[i]===e)}},function(e,t,n){var r=n(3);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw a!==void 0&&r(a.call(e)),t}}},function(e,t,n){var r=n(49),i=n(17),a=n(18),o={};n(5)(o,n(1)(`iterator`),function(){return this}),e.exports=function(e,t,n){e.prototype=r(o,{next:i(1,n)}),a(e,t+` Iterator`)}},function(e,t,n){var r=n(1)(`iterator`),i=!1;try{var a=[7][r]();a.return=function(){i=!0},Array.from(a,function(){throw 2})}catch{}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var a=[7],o=a[r]();o.next=function(){return{done:n=!0}},a[r]=function(){return o},e(a)}catch{}return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(2),i=n(30).set,a=r.MutationObserver||r.WebKitMutationObserver,o=r.process,s=r.Promise,c=n(11)(o)==`process`;e.exports=function(){var e,t,n,l=function(){var r,i;for(c&&(r=o.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(c)n=function(){o.nextTick(l)};else if(a){var u=!0,d=document.createTextNode(``);new a(l).observe(d,{characterData:!0}),n=function(){d.data=u=!u}}else if(s&&s.resolve){var f=s.resolve();n=function(){f.then(l)}}else n=function(){i.call(r,l)};return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){var r=n(3),i=n(50),a=n(22),o=n(19)(`IE_PROTO`),s=function(){},c=`prototype`,l=function(){var e,t=n(16)(`iframe`),r=a.length,i=`>`;for(t.style.display=`none`,n(25).appendChild(t),t.src=`javascript:`,e=t.contentWindow.document,e.open(),e.write(`<script>document.F=Object<\/script`+i),e.close(),l=e.F;r--;)delete l[c][a[r]];return l()};e.exports=Object.create||function(e,t){var n;return e===null?n=l():(s[c]=r(e),n=new s,s[c]=null,n[o]=e),t===void 0?n:i(n,t)}},function(e,t,n){var r=n(12),i=n(3),a=n(54);e.exports=n(4)?Object.defineProperties:function(e,t){i(e);for(var n,o=a(t),s=o.length,c=0;s>c;)r.f(e,n=o[c++],t[n]);return e}},function(e,t,n){var r=n(55),i=n(17),a=n(13),o=n(32),s=n(8),c=n(26),l=Object.getOwnPropertyDescriptor;t.f=n(4)?l:function(e,t){if(e=a(e),t=o(t,!0),c)try{return l(e,t)}catch{}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(8),i=n(63),a=n(19)(`IE_PROTO`),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,a)?e[a]:typeof e.constructor==`function`&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e,t,n){var r=n(8),i=n(13),a=n(39)(!1),o=n(19)(`IE_PROTO`);e.exports=function(e,t){var n,s=i(e),c=0,l=[];for(n in s)n!=o&&r(s,n)&&l.push(n);for(;t.length>c;)r(s,n=t[c++])&&(~a(l,n)||l.push(n));return l}},function(e,t,n){var r=n(53),i=n(22);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(5);e.exports=function(e,t,n){for(var i in t)n&&e[i]?e[i]=t[i]:r(e,i,t[i]);return e}},function(e,t,n){e.exports=n(5)},function(e,t,n){var r=n(9),i=n(3),a=function(e,t){if(i(e),!r(t)&&t!==null)throw TypeError(t+`: can't set as prototype!`)};e.exports={set:Object.setPrototypeOf||(`__proto__`in{}?function(e,t,r){try{r=n(7)(Function.call,n(51).f(Object.prototype,`__proto__`).set,2),r(e,[]),t=!(e instanceof Array)}catch{t=!0}return function(e,n){return a(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:a}},function(e,t,n){var r=n(2),i=n(6),a=n(12),o=n(4),s=n(1)(`species`);e.exports=function(e){var t=typeof i[e]==`function`?i[e]:r[e];o&&t&&!t[s]&&a.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(3),i=n(14),a=n(1)(`species`);e.exports=function(e,t){var n,o=r(e).constructor;return o===void 0||(n=r(o)[a])==null?t:i(n)}},function(e,t,n){var r=n(20),i=n(15);e.exports=function(e){return function(t,n){var a,o,s=String(i(t)),c=r(n),l=s.length;return c<0||c>=l?e?``:void 0:(a=s.charCodeAt(c),a<55296||a>56319||c+1===l||(o=s.charCodeAt(c+1))<56320||o>57343?e?s.charAt(c):a:e?s.slice(c,c+2):(a-55296<<10)+(o-56320)+65536)}}},function(e,t,n){var r=n(20),i=Math.max,a=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):a(e,t)}},function(e,t,n){var r=n(15);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(21),i=n(1)(`iterator`),a=n(10);e.exports=n(6).getIteratorMethod=function(e){if(e!=null)return e[i]||e[`@@iterator`]||a[r(e)]}},function(e,t,n){var r=n(37),i=n(47),a=n(10),o=n(13);e.exports=n(27)(Array,`Array`,function(e,t){this._t=o(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):t==`keys`?i(0,n):t==`values`?i(0,e[n]):i(0,[n,e[n]])},`values`),a.Arguments=a.Array,r(`keys`),r(`values`),r(`entries`)},function(e,t){},function(e,t,n){var r,i,a,o=n(28),s=n(2),c=n(7),l=n(21),u=n(23),d=n(9),f=(n(3),n(14)),p=n(38),m=n(40),h=(n(58).set,n(60)),g=n(30).set,_=n(48)(),v=`Promise`,y=s.TypeError,b=s.process,x=s[v],b=s.process,S=l(b)==`process`,C=function(){},w=!!function(){try{var e=x.resolve(1),t=(e.constructor={})[n(1)(`species`)]=function(e){e(C,C)};return(S||typeof PromiseRejectionEvent==`function`)&&e.then(C)instanceof t}catch{}}(),ee=function(e,t){return e===t||e===x&&t===a},T=function(e){var t;return!(!d(e)||typeof(t=e.then)!=`function`)&&t},E=function(e){return ee(x,e)?new D(e):new i(e)},D=i=function(e){var t,n;this.promise=new e(function(e,r){if(t!==void 0||n!==void 0)throw y(`Bad Promise constructor`);t=e,n=r}),this.resolve=f(t),this.reject=f(n)},O=function(e){try{e()}catch(e){return{error:e}}},k=function(e,t){if(!e._n){e._n=!0;var n=e._c;_(function(){for(var r=e._v,i=e._s==1,a=0,o=function(t){var n,a,o=i?t.ok:t.fail,s=t.resolve,c=t.reject,l=t.domain;try{o?(i||(e._h==2&&re(e),e._h=1),o===!0?n=r:(l&&l.enter(),n=o(r),l&&l.exit()),n===t.promise?c(y(`Promise-chain cycle`)):(a=T(n))?a.call(n,s,c):s(n)):c(r)}catch(e){c(e)}};n.length>a;)o(n[a++]);e._c=[],e._n=!1,t&&!e._h&&te(e)})}},te=function(e){g.call(s,function(){var t,n,r,i=e._v;if(ne(e)&&(t=O(function(){S?b.emit(`unhandledRejection`,i,e):(n=s.onunhandledrejection)?n({promise:e,reason:i}):(r=s.console)&&r.error&&r.error(`Unhandled promise rejection`,i)}),e._h=S||ne(e)?2:1),e._a=void 0,t)throw t.error})},ne=function(e){if(e._h==1)return!1;for(var t,n=e._a||e._c,r=0;n.length>r;)if(t=n[r++],t.fail||!ne(t.promise))return!1;return!0},re=function(e){g.call(s,function(){var t;S?b.emit(`rejectionHandled`,e):(t=s.onrejectionhandled)&&t({promise:e,reason:e._v})})},ie=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||=t._c.slice(),k(t,!0))},ae=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw y(`Promise can't be resolved itself`);(t=T(e))?_(function(){var r={_w:n,_d:!1};try{t.call(e,c(ae,r,1),c(ie,r,1))}catch(e){ie.call(r,e)}}):(n._v=e,n._s=1,k(n,!1))}catch(e){ie.call({_w:n,_d:!1},e)}}};w||(x=function(e){p(this,x,v,`_h`),f(e),r.call(this);try{e(c(ae,this,1),c(ie,this,1))}catch(e){ie.call(this,e)}},r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(56)(x.prototype,{then:function(e,t){var n=E(h(this,x));return n.ok=typeof e!=`function`||e,n.fail=typeof t==`function`&&t,n.domain=S?b.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&k(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),D=function(){var e=new r;this.promise=e,this.resolve=c(ae,e,1),this.reject=c(ie,e,1)}),u(u.G+u.W+u.F*!w,{Promise:x}),n(18)(x,v),n(59)(v),a=n(6)[v],u(u.S+u.F*!w,v,{reject:function(e){var t=E(this),n=t.reject;return n(e),t.promise}}),u(u.S+u.F*(o||!w),v,{resolve:function(e){if(e instanceof x&&ee(e.constructor,this))return e;var t=E(this),n=t.resolve;return n(e),t.promise}}),u(u.S+u.F*!(w&&n(46)(function(e){x.all(e).catch(C)})),v,{all:function(e){var t=this,n=E(t),r=n.resolve,i=n.reject,a=O(function(){var n=[],a=0,o=1;m(e,!1,function(e){var s=a++,c=!1;n.push(void 0),o++,t.resolve(e).then(function(e){c||(c=!0,n[s]=e,--o||r(n))},i)}),--o||r(n)});return a&&i(a.error),n.promise},race:function(e){var t=this,n=E(t),r=n.reject,i=O(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i&&r(i.error),n.promise}})},function(e,t,n){var r=n(61)(!0);n(27)(String,`String`,function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){n(65);for(var r=n(2),i=n(5),a=n(10),o=n(1)(`toStringTag`),s=[`NodeList`,`DOMTokenList`,`MediaList`,`StyleSheetList`,`CSSRuleList`],c=0;c<5;c++){var l=s[c],u=r[l],d=u&&u.prototype;d&&!d[o]&&i(d,o,l),a[l]=a.Array}},function(e,t){e.exports=n(`child_process`)},function(e,t){e.exports=n(`crypto`)}])})}))(),1);const JC=/^(?![-0-9])(?!.*--)[a-z0-9]*(?:-[a-z0-9]+)*$/i,YC=`https://www.jsrepo.com`;function XC(e={}){let t=e.baseUrl??YC;return{name:`jsrepo`,matches:e=>e.startsWith(`@`),create:(t,n)=>ZC.create(t,e,n),auth:{tokenStoredFor:`provider`,envVar:`JSREPO_TOKEN`,getToken:e=>QC(e,t)},baseUrl:t}}var ZC=class e{constructor(e,t){this.state=e,this.opts=t}static async create(t,n,r){return new e(await e.getState(t,n),n)}async fetch(t,{token:n,fetch:r=fetch}){let i=this.resolveRaw(t);try{let t={...e.authHeader(n)??{}},a=await r(i.toString(),{headers:t});if(!a.ok)throw a.headers.get(`content-type`)?.includes(`application/json`)?new S(`${a.status} ${(await a.json()).message??a.statusText}`,i.toString()):new S(`${a.status} ${a.statusText}`,i.toString());return await a.text()}catch(e){throw e instanceof S?new S(e.originalMessage,i.toString()):new S(`${e instanceof Error?e.message:String(e)}`,i.toString())}}static async getState(t,n){return{...e.parseUrl(t),baseUrl:n.baseUrl??YC}}static parseUrl(e){let[t,n,...r]=e.split(`/`);if(!t||!n)throw Error(`Failed to parse invalid URL: ${e}`);let[i,a]=n.split(`@`);if(!i)throw Error(`Failed to parse invalid URL: ${e}`);let o;return r.length>0&&(o=r.join(`/`)),{url:`${t}/${n}`,specifier:o,scope:t,registryName:i,version:a??`latest`}}resolveRaw(e){let{scope:t,registryName:n,version:r,baseUrl:i}=this.state;return new URL(`${WC(i)}api/scopes/${t}/${n}/v/${r}/files/${e}`)}static authHeader(e){if(e)return{"x-api-key":e}}};const QC=async({p:e},t)=>{let n=qC.default.machineIdSync(!0),r;try{let e=await fetch(`${t}/api/login/device`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({hardwareId:n})});if(!e.ok)throw Error(`There was an error creating the session`);r=(await e.json()).id}catch(e){throw new D(e instanceof Error?e.message:String(e),{suggestion:`Please try again.`})}e.log.step(`Sign in at ${e.color.cyan(`${t}/login/device/${r}`)}`);let i=e.spinner(),a=setTimeout(()=>{throw i.stop(`You never signed in.`),new D(`Session timed out!`,{suggestion:`Please try again.`})},54e6);for(i.start(`Waiting for you to sign in...`);;){await ic(5e3);let e=`${t}/api/login/device/${r}`;try{let t=await fetch(e,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({hardwareId:n})});if(!t.ok)continue;clearTimeout(a);let r=await t.text();return i.stop(`Done`),r}catch{}}},$C=[XC(),RC(),HC(),MC(),OC(),GC()];async function ew(e,t){try{return sc(EC,await e.fetch(vy,t))}catch(e){return(0,U.err)(new y(e))}}export{zu as $,uy as A,tp as B,xC as C,Re as Ct,vy as D,Py as E,f_ as F,Zf as G,ep as H,c_ as I,qu as J,td as K,i_ as L,h_ as M,__ as N,wy as O,d_ as P,$u as Q,t_ as R,sC as S,Be as St,Fy as T,ze as Tt,Rf as U,Bf as V,zf as W,Qu as X,Ku as Y,Zu as Z,oC as _,vs as _t,GC as a,Yc as at,aC as b,fs as bt,PC as c,sc as ct,EC as d,ec as dt,tu as et,CC as f,ac as ft,SC as g,as as gt,hC as h,ls as ht,XC as i,el as it,p_ as j,by as k,MC as l,oc as lt,vC as m,gs as mt,ew as n,Yl as nt,HC as o,Xc as ot,fC as p,Ds as pt,Yu as q,JC as r,Kl as rt,RC as s,Wc as st,$C as t,Jl as tt,OC as u,rc as ut,bC as v,Ts as vt,iC as w,Le as wt,_C as x,L as xt,gC as y,B as yt,Qg as z};
|
|
85
|
-
//# sourceMappingURL=providers-
|
|
85
|
+
//# sourceMappingURL=providers-Dc3L9h_M.mjs.map
|
package/package.json
CHANGED
package/dist/errors-C7KsbF1p.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./picocolors-DQPB0Sb5.mjs";var n=e(t(),1),r=class extends Error{suggestion;docsLink;constructor(e,t){super(e),this.suggestion=t.suggestion,this.docsLink=t.docsLink}toString(){return`${this.message} ${this.suggestion}${n.default.gray(this.docsLink?`\n See: ${this.docsLink}`:``)}`}},i=class extends r{constructor(){super(`No package.json found.`,{suggestion:`Please run create a package.json first before initializing a jsrepo project.`})}},a=class extends r{constructor(e){super(`Invalid registry: ${n.default.bold(e)} A provider for this registry was not found.`,{suggestion:`Maybe you need to add a provider for this registry?`,docsLink:`See: https://jsrepo.dev/docs/providers`})}},o=class extends r{constructor(e,t){super(`${n.default.bold(e)} not found in ${n.default.bold(t?`${t}`:`any registry`)}.`,{suggestion:t?`Run ${n.default.bold(`\`jsrepo add --registry ${t}\``)} to list all items in this registry`:`Run ${n.default.bold(`jsrepo add`)} to list all available registry items.`})}},s=class extends r{resourcePath;originalMessage;constructor(e,t){super(`Error fetching ${t}: ${e}`,{suggestion:`Please try again.`}),this.resourcePath=t,this.originalMessage=e}},c=class e extends r{constructor(t){super(t instanceof s?`Error fetching manifest file from ${n.default.bold(t.resourcePath)}: ${t.originalMessage}`:t instanceof e?t.message:`Error fetching manifest file: ${t instanceof Error?t.message:String(t)}`,{suggestion:`Please try again.`})}},l=class extends r{constructor(e,t){super(e instanceof s?`Error fetching ${n.default.bold(`${t.registry}/${t.item}`)} from ${n.default.bold(e.resourcePath)}: ${e.originalMessage}`:`Error fetching ${t.registry}/${t.item}: ${e instanceof Error?e.message:String(e)}`,{suggestion:`Please try again.`})}},u=class extends r{constructor(e,t){super(`Error fetching ${n.default.bold(`${t.registry}/${t.item}`)}${t.resourcePath?` from ${n.default.bold(t.resourcePath)}`:``}: ${e}`,{suggestion:`Please try again.`})}},d=class extends r{constructor(){super(`No registry was provided.`,{suggestion:"Fully qualify blocks ex: (github/ieedan/std/math) or supply them in your config with the `registries` key."})}},f=class extends r{constructor(e,t){super(`${t.map((e,n)=>`${n===t.length-1?`and `:``}${e}`).join(`, `)} contain ${n.default.bold(e)}.`,{suggestion:`You will have to be more specific by providing the registry url like: ${n.default.bold(`\`${t[0]}/${e}\``)}.`})}},p=class extends r{constructor(){super(`Config already initialized.`,{suggestion:`To configure a new registry run ${n.default.bold("`jsrepo init <registry>`")}.`})}},m=class extends r{constructor(e){super(`Failed to load config: ${e instanceof Error?e.message:String(e)}`,{suggestion:`Please try again.`})}},h=class extends r{constructor(e){super(`Config not found at ${n.default.bold(e)}.`,{suggestion:"Please run `jsrepo init` to create a config file.",docsLink:`https://jsrepo.dev/docs/jsrepo-config`})}},g=class extends r{constructor(e){super(`Invalid options: ${e.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `)}`,{suggestion:`Please check the options and try again.`})}},_=class extends r{constructor(){super(`No registries were found in the config.`,{suggestion:"Please define at least one registry using the `registry` key."})}},v=class extends r{constructor({item:e,type:t}){super(`No path was provided for ${n.default.bold(e)} of type ${n.default.bold(t)}.`,{suggestion:"Please configure a path with the `paths` key.",docsLink:`https://jsrepo.dev/docs/jsrepo-config#paths`})}},y=class extends r{registryName;constructor(e,t){super(e,{suggestion:t.suggestion,docsLink:t.docsLink}),this.registryName=t.registryName}},b=class extends r{constructor(e,{fileName:t}){super(`Module referenced by ${n.default.bold(t)}: ${n.default.bold(e)} not found.`,{suggestion:`Please ensure the module exists.`})}},x=class extends y{constructor({registryName:e}){super(`No outputs were defined in the registry ${n.default.bold(e)}.`,{registryName:e,suggestion:"Please define at least one output using the `registry.outputs` key.",docsLink:`https://jsrepo.dev/docs/outputs`})}},S=class extends y{constructor({registryName:e}){super(`No items were listed in the registry ${n.default.bold(e)}.`,{registryName:e,suggestion:"Please list at least one item using the `items` key."})}},C=class extends y{constructor({name:e,registryName:t}){super(`Duplicate item name: ${n.default.bold(e)}.`,{registryName:t,suggestion:`Please ensure each item has a unique name.`})}},w=class extends y{constructor({name:e,registryName:t}){super(`Self reference: ${n.default.bold(e)}.`,{registryName:t,suggestion:`Please ensure each item does not reference itself.`})}},T=class extends y{constructor({name:e,registryName:t}){super(`No files were listed in the item ${n.default.bold(e)}.`,{registryName:t,suggestion:"Please list at least one file using the `files` key."})}},E=class extends y{constructor({name:e,registryName:t}){super(`Illegal item name: ${n.default.bold(e)}.`,{registryName:t,suggestion:`Please update the name of your item.`})}},D=class extends y{constructor({dependency:e,item:t,registryName:r}){super(`Invalid registry dependency: ${n.default.bold(e)} for item ${n.default.bold(t)}.`,{registryName:r,suggestion:`Please ensure the dependency is a valid item in the registry.`})}},O=class extends y{constructor({dependency:e,registryName:t,itemName:r}){super(`Invalid dependency: ${n.default.bold(e)} for ${n.default.bold(r)}.`,{registryName:t,suggestion:`Please ensure the dependency is a valid npm package name.`})}},k=class extends y{constructor({path:e,parent:t,duplicateParent:r,registryName:i}){super(`Duplicate file reference: ${n.default.bold(e)} is in both ${n.default.bold(`${t.type}/${t.name}`)} and ${n.default.bold(`${r.type}/${r.name}`)}.`,{registryName:i,suggestion:`Please ensure the file is not referenced multiple times.`})}},A=class extends y{constructor({path:e,parent:t,registryName:r}){super(`File not found: ${n.default.bold(e)} in ${n.default.bold(t.name)} of type ${n.default.bold(t.type)}.`,{registryName:r,suggestion:`Please ensure the file exists.`})}},j=class extends y{constructor({referencedFile:e,fileName:t,item:r,registryName:i}){super(`Imported file not resolved: ${n.default.bold(e)} in ${n.default.bold(t)} of item ${n.default.bold(r)}.`,{registryName:i,suggestion:`Make sure the file exists and is part of the registry.`})}},M=class extends r{constructor(e){super(`Invalid plugin name: ${n.default.bold(e)} is not a valid npm package name.`,{suggestion:`Double check the plugin name and try again.`})}},N=class extends r{constructor({key:e,type:t}){super(`The ${n.default.bold(e)} key in your config must be an ${n.default.bold(t)}.`,{suggestion:`Please check your config and try again.`})}},P=class extends r{constructor(){super(`We couldn't locate the config object in your config.`,{suggestion:`Please check your config and try again.`})}},F=class extends r{constructor(){super(`We couldn't find the jsrepo import in your config.`,{suggestion:`Please check your config and try again.`})}},I=class extends r{zodError;constructor(e){super(`Zod error: ${e.message}`,{suggestion:`Check the input schema and try again.`}),this.zodError=e}},L=class extends r{constructor(e){super(`Invalid JSON: ${e instanceof Error?e.stack??e.message:`${e}`}`,{suggestion:`Check the input JSON and try again.`})}},R=class extends y{constructor(e,t,r){super(`Error while parsing glob pattern ${n.default.bold(t)}: ${e instanceof Error?e.message:String(e)}`,{registryName:r,suggestion:`Please check the glob pattern and try again.`})}},z=class extends r{constructor(e){super(`No provider found for ${n.default.bold(e)}. Maybe you need to add it to your config?`,{suggestion:`Please check the provider name and try again.`})}},B=class extends r{constructor(){super(`We couldn't find any items to update.`,{suggestion:"Add items to your project using `jsrepo add` and then run `jsrepo update` to update them."})}},V=class extends r{constructor(e,t){super(`${n.default.bold(e)} is required for ${t} to work.`,{suggestion:`Please install it.`})}},H=class extends r{constructor(e){super(`Invalid registry name: ${n.default.bold(e)} is not a valid name. The name should be provided as ${n.default.bold("`@<scope>/<registry>`")}.`,{suggestion:`Please check the registry name and try again.`})}},U=class extends r{constructor(e,t){e===void 0?super(`No version was provided for ${n.default.bold(t)}.`,{suggestion:`Please provide a version using the ${n.default.bold("`version`")} key.`}):super(`Invalid version for ${n.default.bold(t)}: ${n.default.bold(e)} is not a valid version. The version should be provided as ${n.default.bold("`<major>.<minor>.<patch>`")}.`,{suggestion:`Please check the registry version and try again.`})}},W=class extends r{constructor(){super(`This code path should be unreachable.`,{suggestion:`This is a bug, please report it.`})}};export{x as A,w as B,c as C,T as D,f as E,s as F,I as H,u as I,l as L,v as M,z as N,B as O,_ as P,o as R,r as S,b as T,W as V,M as _,F as a,H as b,m as c,E as d,j as f,g,N as h,P as i,i as j,S as k,A as l,L as m,y as n,k as o,O as p,h as r,C as s,p as t,R as u,D as v,V as w,U as x,a as y,d as z};
|
|
2
|
-
//# sourceMappingURL=errors-C7KsbF1p.mjs.map
|