UNPKG

@novu/framework

Version:

The Code-First Notifications Workflow SDK.

32 lines (31 loc) 225 kB
"use strict";var $s=Object.create;var Kt=Object.defineProperty;var js=Object.getOwnPropertyDescriptor;var Ys=Object.getOwnPropertyNames;var Ws=Object.getPrototypeOf,Vs=Object.prototype.hasOwnProperty;var Bs=(l,r)=>{for(var n in r)Kt(l,n,{get:r[n],enumerable:!0})},Oi=(l,r,n,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let w of Ys(r))!Vs.call(l,w)&&w!==n&&Kt(l,w,{get:()=>r[w],enumerable:!(p=js(r,w))||p.enumerable});return l};var et=(l,r,n)=>(n=l!=null?$s(Ws(l)):{},Oi(r||!l||!l.__esModule?Kt(n,"default",{value:l,enumerable:!0}):n,l)),qs=l=>Oi(Kt({},"__esModule",{value:!0}),l);var el={};Bs(el,{Client:()=>St,CronExpression:()=>cr,NovuRequestHandler:()=>kn,SeverityLevelEnum:()=>$n,providerSchemas:()=>Ln,step:()=>xo,workflow:()=>Po});module.exports=qs(el);var Qi=require("jsonrepair");var Pt=(p=>(p.TRIGGER="trigger",p.EXECUTE="execute",p.PREVIEW="preview",p))(Pt||{}),Ht=(p=>(p.DISCOVER="discover",p.HEALTH_CHECK="health-check",p.CODE="code",p))(Ht||{});var cr=(U=>(U.EVERY_SECOND="* * * * * *",U.EVERY_5_SECONDS="*/5 * * * * *",U.EVERY_10_SECONDS="*/10 * * * * *",U.EVERY_30_SECONDS="*/30 * * * * *",U.EVERY_MINUTE="*/1 * * * *",U.EVERY_5_MINUTES="0 */5 * * * *",U.EVERY_10_MINUTES="0 */10 * * * *",U.EVERY_30_MINUTES="0 */30 * * * *",U.EVERY_HOUR="0 0-23/1 * * *",U.EVERY_2_HOURS="0 0-23/2 * * *",U.EVERY_3_HOURS="0 0-23/3 * * *",U.EVERY_4_HOURS="0 0-23/4 * * *",U.EVERY_5_HOURS="0 0-23/5 * * *",U.EVERY_6_HOURS="0 0-23/6 * * *",U.EVERY_7_HOURS="0 0-23/7 * * *",U.EVERY_8_HOURS="0 0-23/8 * * *",U.EVERY_9_HOURS="0 0-23/9 * * *",U.EVERY_10_HOURS="0 0-23/10 * * *",U.EVERY_11_HOURS="0 0-23/11 * * *",U.EVERY_12_HOURS="0 0-23/12 * * *",U.EVERY_DAY_AT_1AM="0 01 * * *",U.EVERY_DAY_AT_2AM="0 02 * * *",U.EVERY_DAY_AT_3AM="0 03 * * *",U.EVERY_DAY_AT_4AM="0 04 * * *",U.EVERY_DAY_AT_5AM="0 05 * * *",U.EVERY_DAY_AT_6AM="0 06 * * *",U.EVERY_DAY_AT_7AM="0 07 * * *",U.EVERY_DAY_AT_8AM="0 08 * * *",U.EVERY_DAY_AT_9AM="0 09 * * *",U.EVERY_DAY_AT_10AM="0 10 * * *",U.EVERY_DAY_AT_11AM="0 11 * * *",U.EVERY_DAY_AT_NOON="0 12 * * *",U.EVERY_DAY_AT_1PM="0 13 * * *",U.EVERY_DAY_AT_2PM="0 14 * * *",U.EVERY_DAY_AT_3PM="0 15 * * *",U.EVERY_DAY_AT_4PM="0 16 * * *",U.EVERY_DAY_AT_5PM="0 17 * * *",U.EVERY_DAY_AT_6PM="0 18 * * *",U.EVERY_DAY_AT_7PM="0 19 * * *",U.EVERY_DAY_AT_8PM="0 20 * * *",U.EVERY_DAY_AT_9PM="0 21 * * *",U.EVERY_DAY_AT_10PM="0 22 * * *",U.EVERY_DAY_AT_11PM="0 23 * * *",U.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",U.EVERY_WEEK="0 0 * * 0",U.EVERY_WEEKDAY="0 0 * * 1-5",U.EVERY_WEEKEND="0 0 * * 6,0",U.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",U.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",U.EVERY_2ND_DAY_OF_MONTH_AT_10AM="0 10 2 * *",U.EVERY_2ND_HOUR="0 */2 * * *",U.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",U.EVERY_2ND_MONTH="0 0 1 */2 *",U.EVERY_QUARTER="0 0 1 */3 *",U.EVERY_6_MONTHS="0 0 1 */6 *",U.EVERY_YEAR="0 0 1 0 *",U.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",U.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",U.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",U.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",U.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",U.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",U.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",U.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",U.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",U.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",U.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",U.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",U.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",U.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",U.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",U.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",U.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",U.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",U.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",U.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",U.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",U.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",U.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",U.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",U.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",U.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",U.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",U.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5",U))(cr||{});var We=(ce=>(ce.BRIDGE_ERROR="BridgeError",ce.EXECUTION_EVENT_CONTROL_INVALID_ERROR="ExecutionEventControlInvalidError",ce.EXECUTION_EVENT_PAYLOAD_INVALID_ERROR="ExecutionEventPayloadInvalidError",ce.EXECUTION_PROVIDER_OUTPUT_INVALID_ERROR="ExecutionProviderOutputInvalidError",ce.EXECUTION_STATE_CONTROL_INVALID_ERROR="ExecutionStateControlInvalidError",ce.EXECUTION_STATE_CORRUPT_ERROR="ExecutionStateCorruptError",ce.EXECUTION_STATE_OUTPUT_INVALID_ERROR="ExecutionStateOutputInvalidError",ce.EXECUTION_STATE_RESULT_INVALID_ERROR="ExecutionStateResultInvalidError",ce.INVALID_ACTION_ERROR="InvalidActionError",ce.METHOD_NOT_ALLOWED_ERROR="MethodNotAllowedError",ce.MISSING_DEPENDENCY_ERROR="MissingDependencyError",ce.MISSING_SECRET_KEY_ERROR="MissingSecretKeyError",ce.PROVIDER_EXECUTION_FAILED_ERROR="ProviderExecutionFailedError",ce.PROVIDER_NOT_FOUND_ERROR="ProviderNotFoundError",ce.SIGNATURE_EXPIRED_ERROR="SignatureExpiredError",ce.SIGNATURE_INVALID_ERROR="SignatureInvalidError",ce.SIGNATURE_MISMATCH_ERROR="SignatureMismatchError",ce.SIGNATURE_NOT_FOUND_ERROR="SignatureNotFoundError",ce.SIGNATURE_VERSION_INVALID_ERROR="SignatureVersionInvalidError",ce.SIGNING_KEY_NOT_FOUND_ERROR="SigningKeyNotFoundError",ce.STEP_ALREADY_EXISTS_ERROR="StepAlreadyExistsError",ce.STEP_CONTROL_COMPILATION_FAILED_ERROR="StepControlCompilationFailedError",ce.STEP_EXECUTION_FAILED_ERROR="StepExecutionFailedError",ce.STEP_NOT_FOUND_ERROR="StepNotFoundError",ce.WORKFLOW_ALREADY_EXISTS_ERROR="WorkflowAlreadyExistsError",ce.WORKFLOW_NOT_FOUND_ERROR="WorkflowNotFoundError",ce.WORKFLOW_PAYLOAD_INVALID_ERROR="WorkflowPayloadInvalidError",ce))(We||{});var zt=(p=>(p.POST="POST",p.GET="GET",p.OPTIONS="OPTIONS",p))(zt||{});var Js=l=>{var n,p;if(typeof l!="object"||l===null)return!1;let r=Object.getPrototypeOf(l);return(p=(n=r==null?void 0:r.constructor)==null?void 0:n.name.endsWith("Error"))!=null?p:!1},tt=class extends Error{},Xt=class extends tt{constructor(){super(...arguments);this.statusCode=404}},Ue=class extends tt{constructor(){super(...arguments);this.statusCode=400}},ot=class extends tt{constructor(){super(...arguments);this.statusCode=401}},st=class extends tt{constructor(r,{cause:n}={}){var p;Js(n)?(super(`${r}: ${n.message}`),this.data={stack:(p=n.stack)!=null?p:r}):(super(`${r}${n?`: ${JSON.stringify(n,null,2)}`:""}`),this.data={stack:r})}},Qt=class extends tt{constructor(){super(...arguments);this.statusCode=409}};var mt=class extends st{constructor(n){super("Unknown BridgeError",{cause:n});this.statusCode=500;this.code="BridgeError"}};var Zt=class extends Ue{constructor(n,p){super(`Workflow with id: \`${n}\` has a corrupt state. Step with id: \`${p}\` does not exist. Please provide the missing state.`);this.code="ExecutionStateCorruptError";this.data={workflowId:n,stepId:p}}},It=class extends Ue{constructor(n,p){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct event payload.`);this.code="ExecutionEventPayloadInvalidError";this.data=p}},en=class extends Ue{constructor(n,p){super(`Workflow with id: \`${n}\` has invalid \`controls\`. Please provide the correct event controls.`);this.code="ExecutionEventControlInvalidError";this.data=p}},tn=class extends Ue{constructor(n,p,w){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${p}\` has invalid \`controls\`. Please provide the correct step controls.`);this.code="ExecutionStateControlInvalidError";this.data=w}},nn=class extends Ue{constructor(n,p,w){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${p}\` has invalid output. Please provide the correct step output.`);this.code="ExecutionStateOutputInvalidError";this.data=w}},rn=class extends Ue{constructor(n,p,w){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${p}\` has invalid result. Please provide the correct step result.`);this.code="ExecutionStateResultInvalidError";this.data=w}},on=class extends Ue{constructor(n,p,w){super(`Workflow with id: \`${n}\` has invalid controls syntax in step with id: \`${p}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=w}},sn=class extends Ue{constructor(n,p,w,F){super(`Workflow with id: \`${n}\` has an invalid state. Step with id: \`${p}\` and provider with id: \`${w}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=F}},an=class extends Ue{constructor(n,p){super(`Workflow with id: \`${n}\` has invalid \`payload\`. Please provide the correct payload.`);this.code="WorkflowPayloadInvalidError";this.data=p}};var lt=l=>Object.values(We).includes(l==null?void 0:l.code),vi=l=>!lt(l)&&typeof l.statusCode=="number"&&l.statusCode>=400&&l.statusCode<500;var pr=l=>Object.values(l).map(r=>`\`${r}\``).join(", "),ln=l=>l.replaceAll(/(\w)(\w*)/g,(r,n,p)=>n.toUpperCase()+p.toLowerCase()).replaceAll(/[\s-]+/g,"");var cn=class extends tt{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${pr(zt)}`}},Nt=class extends Ue{constructor(n,p){super(`Invalid query string: \`action\`=\`${n}\`. Please use one of ${pr(p)}`);this.code="InvalidActionError"}},pn=class extends Ue{constructor(){super("Missing secret key. Set the `NOVU_SECRET_KEY` environment variable or pass `secretKey` to the client options.");this.code="MissingSecretKeyError"}};var un=class extends Error{constructor(r,n,p){super(),this.data={message:p},this.statusCode=r,this.code=n}};var Ct=class extends Qt{constructor(r,n){super(`${ln(r)} with id: \`${n}\` already exists. Please use a different id.`)}},at=class extends Xt{constructor(r,n){super(`${ln(r)} with id: \`${n}\` does not exist. Please provide a valid id.`)}},yt=class extends st{constructor(n,p,w,F){super(`Failed to ${w} ${ln(n)} with id: \`${p}\``,{cause:F});this.statusCode=502}};var dn=class extends at{constructor(n){super("provider",n);this.code="ProviderNotFoundError"}},fn=class extends yt{constructor(n,p,w){super("provider",n,p,w);this.code="ProviderExecutionFailedError"}};var hn=class extends ot{constructor(){super("Signature does not match the expected signature. Please ensure the signature provided in the `novu-signature` header is correct and try again.");this.code="SignatureMismatchError"}},mn=class extends ot{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},yn=class extends ot{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},gn=class extends ot{constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`novu-signature\` header`);this.code="SignatureExpiredError"}},Sn=class extends ot{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}};var wn=class extends at{constructor(n){super("step",n);this.code="StepNotFoundError"}},bn=class extends Ct{constructor(n){super("step",n);this.code="StepAlreadyExistsError"}},kt=class extends yt{constructor(n,p,w){super("step",n,p,w);this.code="StepExecutionFailedError"}};var Mt=class extends at{constructor(n){super("workflow",n);this.code="WorkflowNotFoundError"}};var Tn=(()=>{var l=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,p=Object.prototype.hasOwnProperty,w=(e,t)=>function(){return e&&(t=(0,e[n(e)[0]])(e=0)),t},F=(e,t)=>function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports},k=(e,t)=>{for(var i in t)l(e,i,{get:t[i],enumerable:!0})},z=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of n(t))!p.call(e,u)&&u!==i&&l(e,u,{get:()=>t[u],enumerable:!(c=r(t,u))||c.enumerable});return e},re=e=>z(l({},"__esModule",{value:!0}),e),we={};k(we,{JSONSchemaFaker:()=>bi,default:()=>Ti,setDependencies:()=>Lr});function Pe(e,t){return typeof e=="string"?typeof t!="undefined"?vt.register(e,t):vt.get(e):vt.registerMany(e)}function xe(e,t){return e=typeof e=="undefined"?He.MIN_INTEGER:e,t=typeof t=="undefined"?He.MAX_INTEGER:t,Math.floor(te("random")()*(t-e+1))+e}function be(e){return Yt.default.prototype.max=te("defaultRandExpMax"),Yt.default.prototype.randInt=(i,c)=>i+Math.floor(te("random")()*(1+(c-i))),new Yt.default(e).gen()}function ke(e){return e[Math.floor(te("random")()*e.length)]}function Fe(e){let t,i,c=e.length,u=e.slice();for(;c>0;)i=Math.floor(te("random")()*c),c-=1,t=u[c],u[c]=u[i],u[i]=t;return u}function rt(e,t){return te("random")()*(t-e)+e}function Ge(e,t,i,c,u=!1){return i=typeof i=="undefined"?He.MIN_NUMBER:i,c=typeof c=="undefined"?He.MAX_NUMBER:c,e=typeof e=="undefined"?i:e,t=typeof t=="undefined"?c:t,t<e&&(t+=e),u?rt(e,t):xe(e,t)}function Ft(e){switch(e){case"seconds":return Ge(0,60)*60;case"minutes":return Ge(15,50)*612;case"hours":return Ge(12,72)*36123;case"days":return Ge(7,30)*86412345;case"weeks":return Ge(4,52)*604812345;case"months":return Ge(2,13)*2592012345;case"years":return Ge(1,20)*31104012345;default:break}}function Yn(e){if(e)return Ft(e);let t=te("minDateTime"),i=te("maxDateTime");typeof t=="string"&&(t=new Date(t)),typeof i=="string"&&(i=new Date(i));let c=new Date().getTime();return typeof t=="number"&&(t=new Date(c+t)),typeof i=="number"&&(i=new Date(c+i)),new Date(rt(t.getTime(),i.getTime()))}function mr(e,t,i){if(t=decodeURIComponent(t),i&&i[t])return ce(i[t]);let c=t.replace("#/","/").split("/"),u=e.$ref&&i&&i[e.$ref]||e;for(!u&&!c[0]&&(c[0]=e.$ref.split("#/")[0]),i&&t.includes("#/")&&i[c[0]]&&(u=i[c.shift()]),c[0]||c.shift();u&&c.length>0;){let h=c.shift();if(!u[h])throw new Error(`Prop not found: ${h} (${t})`);u=u[h]}return u}function $t(e){return typeof e=="string"&&qr.test(e)}function Ke(e){return["number","boolean"].includes(typeof e)}function Be(e,...t){return t.filter(i=>typeof e[i]!="undefined").length>0}function yr(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,i,c]=e.split("T")[0].split("-");return i=`0${Math.max(1,Math.min(12,i))}`.slice(-2),c=`0${Math.max(1,Math.min(31,c))}`.slice(-2),`${t}-${i}-${c}`}function Io(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,i]=e.split("T"),[c,u,h]=t.split("-"),[f,O,D]=i.substr(0,8).split(":");return u=`0${Math.max(1,Math.min(12,u))}`.slice(-2),h=`0${Math.max(1,Math.min(31,h))}`.slice(-2),f=`0${Math.max(1,Math.min(23,f))}`.slice(-2),O=`0${Math.max(1,Math.min(59,O))}`.slice(-2),D=`0${Math.max(1,Math.min(59,D))}`.slice(-2),`${c}-${u}-${h}T${f}:${O}:${D}.000Z`}function No(e,t,i){let c={};switch(e||t.type){case"integer":case"number":if(typeof t.minimum!="undefined"&&(c.minimum=t.minimum),typeof t.maximum!="undefined"&&(c.maximum=t.maximum),t.enum){let h=Math.max(c.minimum||0,0),f=Math.min(c.maximum||1/0,1/0);t.exclusiveMinimum&&h===t.minimum&&(h+=t.multipleOf||1),t.exclusiveMaximum&&f===t.maximum&&(f-=t.multipleOf||1),(h||f!==1/0)&&(t.enum=t.enum.filter(O=>O>=h&&O<=f))}break;case"string":{c.minLength=te("minLength")||0,c.maxLength=te("maxLength")||Number.MAX_SAFE_INTEGER,typeof t.minLength!="undefined"&&(c.minLength=Math.max(c.minLength,t.minLength)),typeof t.maxLength!="undefined"&&(c.maxLength=Math.min(c.maxLength,t.maxLength));break}default:break}let u=i(c);if(u==null)return null;switch(e||t.type){case"number":u=$t(u)?parseFloat(u):u;break;case"integer":u=$t(u)?parseInt(u,10):u;break;case"boolean":u=!!u;break;case"string":{if(Ke(u))return u;u=String(u);let h=Math.max(c.minLength||0,0),f=Math.min(c.maxLength||1/0,1/0),O,D=0;for(;u.length<h;)if(O=u,t.pattern?u+=Z.randexp(t.pattern):u+=`${Z.pick([" ","/","_","-","+","=","@","^"])}${u}`,u===O){if(D+=1,D===3)break}else D=0;switch(u.length>f&&(u=u.substr(0,f)),t.format){case"date-time":case"datetime":u=new Date(Io(u)).toISOString().replace(/([0-9])0+Z$/,"$1Z");break;case"full-date":case"date":u=new Date(yr(u)).toISOString().substr(0,10);break;case"time":u=new Date(`1969-01-01 ${u}`).toISOString().substr(11);break;default:break}break}default:break}return u}function dt(e,t){return Object.keys(t).forEach(i=>{typeof t[i]!="object"||t[i]===null?e[i]=t[i]:Array.isArray(t[i])?(e[i]=e[i]||[],t[i].forEach((c,u)=>{e.type==="array"&&t.type==="array"?e[i][u]=dt(e[i][u]||{},c,!0):Array.isArray(e[i])&&e[i].indexOf(c)===-1&&e[i].push(c)})):typeof e[i]!="object"||e[i]===null||Array.isArray(e[i])?e[i]=dt({},t[i]):e[i]=dt(e[i],t[i])}),e}function ce(e,t=new Map){if(!e||typeof e!="object")return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let c=[];return t.set(e,c),c.push(...e.map(u=>ce(u,t))),c}let i={};return t.set(e,i),Object.keys(e).reduce((c,u)=>(c[u]=ce(e[u],t),c),i)}function Co(e){let t=JSON.stringify(e),i=JSON.stringify(e,null,2);return t.length>400?`${i.substr(0,400)}...`:i}function gr(){return Z.pick([!1,!0,null,-1,NaN,Math.PI,1/0,void 0,[],{},Math.random(),Math.random().toString(36).substr(2)])}function ko(e,t){if(e.enum)return e.enum.includes(t);if(e.const)return e.const===t}function Mo(e,t){let i=dt({},t);if(typeof e.minimum!="undefined"&&(i.maximum=e.minimum,i.exclusiveMaximum=!0),typeof e.maximum!="undefined"&&(i.minimum=e.maximum>i.maximum?0:e.maximum,i.exclusiveMinimum=!0),typeof e.minLength!="undefined"&&(i.maxLength=e.minLength),typeof e.maxLength!="undefined"&&(i.minLength=e.maxLength>i.maxLength?0:e.maxLength),e.type)i.type=Z.pick(He.SCALAR_TYPES.filter(c=>(Array.isArray(e.type)?e.type:[e.type]).every(h=>c==="number"||c==="integer"?h!=="number"&&h!=="integer":c!==h)));else if(e.enum){let c;do c=gr();while(e.enum.indexOf(c)!==-1);i.enum=[c]}return e.required&&i.properties&&e.required.forEach(c=>{delete i.properties[c]}),i}function Wn(e,t){let i=t.minimum!==void 0,c=t.maximum!==void 0;return(i||c)&&(!i||e>=t.minimum)&&(!c||e<=t.maximum)}function Lo(e,t){return!t.every(i=>Wn(e,i))}function Do(e,t){return t.reduce((c,u)=>c+(Wn(e,u)?1:0),0)===1}function Uo(e){return["enum","const","default","examples","required","definitions","items","properties"].includes(e)}function Fo(e,t){return Object.keys(e).filter(i=>!t.includes(i)).reduce((i,c)=>(Array.isArray(e[c])?i[c]=e[c].slice():i[c]=e[c]instanceof Object?dt({},e[c]):e[c],i),{})}function Sr(e,t){return Array.isArray(e)?e.map(i=>Sr(i,t)):(typeof e=="string"&&(e=e.replace(/#\{([\w.-]+)\}/g,(i,c)=>t[c])),e)}function Vn(e){return Object.prototype.toString.call(e)==="[object Object]"&&!Object.keys(e).length}function wr(e,t){t=t.items||t;let i=te("alwaysFakeOptionals"),c=Array.isArray(t.required)&&t.required.includes(e)||i,u=typeof t.thunk=="function"||t.additionalProperties&&typeof t.additionalProperties.thunk=="function";return!c&&!u}function Bn(e,t,i=!1){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(c=>Bn(c,t,!0)).filter(c=>typeof c!="undefined");if(Object.keys(e).forEach(c=>{if(Vn(e[c]))wr(c,t)&&delete e[c];else{let u=t;t&&t.properties&&t.properties[c]&&(u=t.properties[c]);let h=Bn(e[c],u);Vn(h)||(e[c]=h)}typeof e[c]=="undefined"&&delete e[c]}),!(!Object.keys(e).length&&i))return e}function $o(e){return(t,i,c,u)=>{let h=t,f=[];typeof t=="object"&&(h=Object.keys(t)[0],Array.isArray(t[h])?f=t[h]:f.push(t[h]));let O=h.split("."),D=e();for(;O.length>1;)D=D[O.shift()];return t=typeof D=="object"?D[O[0]]:D,typeof t=="function"&&(t=t.apply(D,f.map(T=>de.template(T,u)))),Object.prototype.toString.call(t)==="[object Object]"&&Object.keys(t).forEach(T=>{if(typeof t[T]=="function")throw new Error(`Cannot resolve value for '${c}: ${h}', given: ${t}`)}),t}}function jo(e,t){if(typeof e=="undefined")return ht.list();if(typeof e=="string")if(typeof t=="function")ht.register(e,t);else if(t===null||t===!1)ht.unregister(e);else return ht.get(e);else ht.registerMany(e)}function Yo(e,t,i){return Object.keys(e).filter(c=>{let u=Hr.indexOf(t)>-1;return i.indexOf(c)>-1&&!u}).length>0}function Wo(e,t){let i=Object.keys(At);for(let c=0;c<i.length;c+=1){let u=i[c],h=t[t.length-1];if(Yo(e,h,At[u]))return u}}function Vo(){return te("random")()>.5}function Bo(){return null}function qo(e,t,i,c,u,h){let f=[],O=[];function D($){let R=JSON.stringify($.value);return O.indexOf(R)===-1?(O.push(R),f.push($),!0):!1}t.forEach(D);let T=100;for(;f.length!==t.length&&(D(h(i.items||c,e,u))||(T-=1),!!T););return f}function Jo(e,t,i,c){let u=[];if(!(e.items||e.additionalItems)){if(de.hasProperties(e,"minItems","maxItems","uniqueItems")&&(e.minItems!==0||e.maxItems!==0))throw new Wt(`missing items for ${de.short(e)}`,t);return u}if(Array.isArray(e.items))return e.items.map((W,ae)=>{let Q=t.concat(["items",ae]);return c(W,Q,i)});let h=e.minItems,f=e.maxItems,O=te("minItems"),D=te("maxItems");O&&(h=typeof h=="undefined"?O:Math.min(O,h)),D&&(f=typeof f=="undefined"?D:Math.min(D,f),f&&f>D&&(f=D),h&&h>D&&(h=f));let T=te("alwaysFakeOptionals")===!0?1:te("optionalsProbability"),$=te("alwaysFakeOptionals")||te("fixedProbabilities")||!1,R=Z.number(h,f,1,5);T!==null&&(R=Math.max($?Math.round((f||R)*T):Math.abs(Z.number(h,f)*T),h||0));let J=typeof e.additionalItems=="object"?e.additionalItems:{};for(let W=u.length;W<R;W+=1){let ae=t.concat(["items",W]),Q=c(e.items||J,ae,i);u.push(Q)}if(e.contains&&R>0){let W=Z.number(0,R-1);u[W]=c(e.contains,t.concat(["items",W]),i)}return e.uniqueItems?qo(t.concat(["items"]),u,e,J,i,c):u}function Go(e){let t=typeof e.minimum=="undefined"||e.minimum===-Number.MAX_VALUE?He.MIN_INTEGER:e.minimum,i=typeof e.maximum=="undefined"||e.maximum===Number.MAX_VALUE?He.MAX_INTEGER:e.maximum,c=e.multipleOf,u=c&&String(c).match(/e-(\d)|\.(\d+)$/);if(u){let h=(Math.random()*Z.number(0,10)+1)*c,f=u[1]||u[2].length,O=parseFloat(h.toFixed(f)),D=Z.number(t,i-1);return String(O).includes(".")?D+O:(D+O).toExponential()}if(c&&(i=Math.floor(i/c)*c,t=Math.ceil(t/c)*c),e.exclusiveMinimum&&t===e.minimum&&(t+=c||1),e.exclusiveMaximum&&i===e.maximum&&(i-=c||1),t>i)return NaN;if(c){let h=Z.number(Math.floor(t/c),Math.floor(i/c))*c;for(;h<t;)h+=c;return h}return Z.number(t,i,void 0,void 0,e.type!=="integer")}function Ko(e){return Math.floor(ir({...e}))}function Ho(e){return Z.shuffle(oi).slice(0,e)}function zo(e,t,i,c){let u={},h=e.properties||{},f=e.patternProperties||{},O=typeof e.required=="boolean"?[]:(e.required||[]).slice(),D=e.additionalProperties!==!1,T=Object.keys(h),$=Object.keys(f),R=T.concat($).reduce((Y,m)=>(O.indexOf(m)===-1&&Y.push(m),Y),[]),J=O.concat(R),W=D&&e.additionalProperties===!0?Bt:e.additionalProperties;if(!D&&T.length===0&&$.length===0&&de.hasProperties(e,"minProperties","maxProperties","dependencies","required"))return null;if(te("requiredOnly")===!0)return O.forEach(Y=>{h[Y]&&(u[Y]=h[Y])}),c(u,t.concat(["properties"]),i,e);let ae=te("alwaysFakeOptionals")===!0?1:te("optionalsProbability"),Q=te("alwaysFakeOptionals")||te("fixedProbabilities")||!1,ne=te("ignoreProperties")||[],he=te("reuseProperties"),ye=te("fillProperties"),j=e.maxProperties||J.length+(D?Z.number(1,5):0),S=Math.max(e.minProperties||0,O.length),b=Math.max(0,J.length-S);J.length===1&&!O.length&&(S=Math.max(Z.number(ye?1:0,j),S)),ae!==null&&(Q===!0?b=Math.round(S-O.length+ae*(J.length-S)):b=Z.number(S-O.length,ae*(J.length-S)));let _=Z.shuffle(R).slice(0,b),x=R.filter(Y=>_.indexOf(Y)!==-1),M=ae!==null||O.length===j?j:Z.number(0,j),E=O.concat(Z.shuffle(x).slice(0,M)).slice(0,j),I=[],C=[];if(e.dependencies&&(Object.keys(e.dependencies).forEach(Y=>{let m=e.dependencies[Y];if(E.indexOf(Y)!==-1)if(Array.isArray(m))m.forEach(N=>{E.indexOf(N)===-1&&E.push(N)});else if(Array.isArray(m.oneOf||m.anyOf)){let N=m.oneOf||m.anyOf;C.push({prop:Y,values:N})}else I.push(m)}),I.length))return delete e.dependencies,c({allOf:I.concat(e)},t.concat(["properties"]),i,e);let V=[],G=[];E.forEach(Y=>{if(h[Y]&&["{}","true"].includes(JSON.stringify(h[Y].not)))return;for(let N=0;N<ne.length;N+=1)if(ne[N]instanceof RegExp&&ne[N].test(Y)||typeof ne[N]=="string"&&ne[N]===Y||typeof ne[N]=="function"&&ne[N](h[Y],Y)){V.push(Y);return}W===!1&&O.indexOf(Y)!==-1&&(u[Y]=h[Y]),h[Y]&&(u[Y]=h[Y]);let m;if($.forEach(N=>{Y.match(new RegExp(N))&&(m=!0,u[Y]?de.merge(u[Y],f[N]):u[Z.randexp(Y)]=f[N])}),!m){let N=f[Y]||W;N&&W!==!1?u[f[Y]?Z.randexp(Y):Y]=h[Y]||N:G.push(Y)}});let ee=Object.keys(u).length+(ye?0:V.length),ve=Y=>Z.randexp(`_?[_a-f\\d]{1,3}${Y?"\\$?":""}`);function Ae(Y){let m;do{if(!Y.length)break;m=Y.shift()}while(u[m]);return m}let Ee=S;if(D&&!O.length&&(Ee=Math.max(ae===null||W?Z.number(ye?1:0,j):0,S)),!x.length&&!b&&D&&Q===!0&&ye){let Y=Z.number(0,j);for(let m=0;m<Y;m+=1)u[Vt(1)+ve(Y[m])]=W||Bt}for(;ye&&!(!($.length||D)||ee>=Ee);){if(D)if(he&&T.length-ee>Ee){let Y=0,m;do{if(Y+=1,Y>1e3)break;m=Ae(O)||Z.pick(T)}while(typeof u[m]!="undefined");typeof u[m]=="undefined"&&(u[m]=h[m],ee+=1)}else if($.length&&!W){let Y=Z.pick($),m=Z.randexp(Y);u[m]||(u[m]=f[Y],ee+=1)}else{let Y=Ae(O)||Vt(1)+ve();u[Y]||(u[Y]=W||Bt,ee+=1)}for(let Y=0;ee<S&&Y<$.length;Y+=1){let m=$[Y],N=Z.randexp(m);u[N]||(u[N]=f[m],ee+=1)}}if(O.length===0&&(!D||ae===!1)){let Y=Z.number(S,j);for(;ee<Y;){let m=Ae(T);m&&(u[m]=h[m]),ee+=1}}let Ie=u;if(te("sortProperties")!==null){let Y=Object.keys(h);Ie=Object.keys(u).sort((N,K)=>te("sortProperties")?N.localeCompare(K):Y.indexOf(N)-Y.indexOf(K)).reduce((N,K)=>(N[K]=u[K],N),{})}let Me=c(Ie,t.concat(["properties"]),i,e);return C.forEach(Y=>{for(let m of Y.values)if(de.hasValue(m.properties[Y.prop],Me.value[Y.prop])){Object.keys(m.properties).forEach(N=>{N!==Y.prop&&de.merge(Me.value,c(m.properties,t.concat(["properties"]),i,e).value)});break}}),Me}function br(){let e=Z.number(1,5);return Vt(e).join(" ")}function Xo(e=0,t=140){let i=Math.max(0,e),c=Z.number(i,t),u=br();for(;u.length<i;)u+=br();return u.length>c&&(u=u.substr(0,c)),u}function Qo(){return[0,0,0,0].map(()=>Z.number(0,255)).join(".")}function Zo(){return Z.date().toISOString()}function es(){return qt().slice(0,10)}function ts(){return qt().slice(11)}function ns(e){return Z.randexp(je[e]).replace(ui,(t,i)=>Z.randexp(je[i]))}function rs(e,t){let i=rr(e.format);if(typeof i=="function")return i(e);switch(e.format){case"date-time":case"datetime":return qt();case"date":return li();case"time":return ci();case"ipv4":return ai();case"regex":return".+?";case"email":case"hostname":case"ipv6":case"uri":case"uri-reference":case"iri":case"iri-reference":case"idn-email":case"idn-hostname":case"json-pointer":case"slug":case"uri-template":case"uuid":case"duration":return di(e.format);default:if(typeof i=="undefined"){if(te("failOnInvalidFormat"))throw new Error(`unknown registry key ${de.short(e.format)}`);return t()}throw new Error(`unsupported format '${e.format}'`)}}function is(e){return de.typecast("string",e,i=>e.format?rs(e,()=>or(i.minLength,i.maxLength)):e.pattern?Z.randexp(e.pattern):or(i.minLength,i.maxLength))}function os({$comment:e,title:t,description:i}){return Object.entries({comment:e,title:t,description:i}).filter(([,c])=>c).reduce((c,[u,h])=>(c[u]=h,c),{})}function ft(e,t,i,c){if(e=i(e,null,t),e&&(e.oneOf||e.anyOf||e.allOf)&&(e=i(e,null,t)),!e)throw new Error(`Cannot traverse at '${t.join(".")}', given '${JSON.stringify(c)}'`);let u={...os(e),schemaPath:t};if(t[t.length-1]!=="properties"){if(te("useExamplesValue")&&Array.isArray(e.examples)){let T=e.examples.concat("default"in e?[e.default]:[]);return{value:de.typecast(null,e,()=>Z.pick(T)),context:u}}if(te("useExamplesValue")&&typeof e.example!="undefined")return{value:de.typecast(null,e,()=>e.example),context:u};if(te("useDefaultValue")&&"default"in e&&(e.default!==""||!te("replaceEmptyByRandomValue")))return{value:e.default,context:u};if("template"in e)return{value:de.template(e.template,c),context:u};if("const"in e)return{value:e.const,context:u}}if(e.not&&typeof e.not=="object"&&(e=de.notValue(e.not,de.omitProps(e,["not"])),e.type&&e.type==="object")){let{value:T,context:$}=ft(e,t.concat(["not"]),i,c);return{value:de.clean(T,e,!1),context:{...u,items:$}}}if(typeof e.thunk=="function"){let{value:T,context:$}=ft(e.thunk(c),t,i);return{value:T,context:{...u,items:$}}}if(e.jsonPath)return{value:e,context:u};let h=e.type;if(Array.isArray(h)?h=Z.pick(h):typeof h=="undefined"&&(h=zr(e,t)||h,h&&(e.type=h)),typeof e.generate=="function"){let T=de.typecast(null,e,()=>e.generate(c,t)),$=T===null?"null":typeof T;if($===h||$==="number"&&h==="integer"||Array.isArray(T)&&h==="array")return{value:T,context:u}}if(typeof e.pattern=="string")return{value:de.typecast("string",e,()=>Z.randexp(e.pattern)),context:u};if(Array.isArray(e.enum))return{value:de.typecast(null,e,()=>Z.pick(e.enum)),context:u};if(typeof h=="string")if(Rt[h])try{let T=Rt[h](e,t,i,ft);return h==="array"?{value:T.map(({value:$})=>$),context:{...u,items:T.map(Array.isArray(e.items)?({context:$})=>$:({context:$})=>({...$,schemaPath:$.schemaPath.slice(0,-1)}))}}:h==="object"?T!==null?{value:T.value,context:{...u,items:T.context}}:{value:{},context:u}:{value:T,context:u}}catch(T){throw typeof T.path=="undefined"?new Wt(T.stack,t):T}else{if(te("failOnInvalidTypes"))throw new Wt(`unknown primitive ${de.short(h)}`,t.concat(["type"]));{let T=te("defaultInvalidTypeProduct");return typeof T=="string"&&Rt[T]?{value:Rt[T](e,t,i,ft),context:u}:{value:T,context:u}}}let f={},O={...u};Array.isArray(e)&&(f=[]);let D=te("pruneProperties")||[];return Object.keys(e).forEach(T=>{if(!D.includes(T)&&e[T]!==null)if(typeof e[T]=="object"&&T!=="definitions"){let{value:$,context:R}=ft(e[T],t.concat([T]),i,f);f[T]=de.clean($,e[T],!1),O[T]=R,f[T]===null&&te("omitNulls")&&(delete f[T],delete O[T])}else f[T]=e[T]}),{value:f,context:O}}function ss(e){return Array.isArray(e)?Z.pick(e):e}function as(e,t){if(!Array.isArray(e))return e;let i=t?e.pop():e.shift();return t?e.unshift(i):e.push(i),i}function qn(e,t,i,c){if(!e||typeof e!="object")return e;if(i||(i={}),t||(t=e),Array.isArray(e))return e.map(u=>qn(u,t,i,c));if(e.jsonPath){let{JSONPath:u}=Qn(),h=typeof e.jsonPath!="object"?{path:e.jsonPath}:e.jsonPath;h.group=e.group||h.group||c,h.cycle=e.cycle||h.cycle||!1,h.reverse=e.reverse||h.reverse||!1,h.count=e.count||h.count||1;let f=`${h.group}__${h.path}`;return i[f]||(h.count>1?i[f]=u(h.path,t).slice(0,h.count):i[f]=u(h.path,t)),h.cycle||h.reverse?as(i[f],h.reverse):ss(i[f])}return Object.keys(e).forEach(u=>{e[u]=qn(e[u],t,i,u)}),e}function ls(e,t,i,c){if(Object.prototype.toString.call(t)!=="[object Object]")throw new Error(`Invalid input, expecting object but given ${typeof t}`);let u=te("refDepthMin")||0,h=te("refDepthMax")||3;try{let{resolveSchema:f}=gi({refs:e,schema:t,container:i,synchronous:c,refDepthMin:u,refDepthMax:h}),O=mi(de.clone(t),[],f);return te("resolveJsonPath")?{value:qn(O.value),context:O.context}:O}catch(f){throw f.path?new Error(`${f.message} in /${f.path.join("/")}`):f}}function cs(e){return e.value}function ps(e,t){return t.reduce((i,c)=>c in i?i[c]:{},e)}function Jn(e,t,i,c=i){let{title:u,description:h,comment:f}=ps(e,t),O=[];te("renderTitle")&&u&&O.push(` ${u}`,""),te("renderDescription")&&h&&O.push(` ${h}`),te("renderComment")&&f&&O.push(` ${f}`),i.commentBefore=O.join(` `),c instanceof Si?c.items.forEach(D=>{Jn(e,[...t,"items",D.key.value],D.key,D.value)}):c instanceof wi&&c.items.forEach((D,T)=>{Jn(e,[...t,"items",T],D)})}function us({value:e,context:t}){let i=Et.createNode(e);Jn(t,[],i);let c=new Et.Document;return c.contents=i,c.toString()}function Tr(){Xe.define("autoIncrement",function(t,i){if(!this.offset){let c=i.minimum||1,u=c+He.MAX_NUMBER,h=t.initialOffset||i.initialOffset;this.offset=h||Z.number(c,u)}return t?this.offset++:i}),Xe.define("sequentialDate",function(t,i){if(this.now||(this.now=Z.date()),t){if(i=this.now.toISOString(),t=t===!0?"days":t,["seconds","minutes","hours","days","weeks","months","years"].indexOf(t)===-1)throw new Error(`Unsupported increment by ${de.short(t)}`);this.now.setTime(this.now.getTime()+Z.date(t))}return i})}function Or(e,t){let i={};Array.isArray(e)?e.forEach(u=>{i[u.$id||u.id]=u}):i=e||{};function c(u){if(!u||typeof u!="object")return;if(Array.isArray(u))return u.forEach(c);let h=u.$id||u.id;typeof h=="string"&&!i[h]&&(i[h]=u),Object.keys(u).forEach(f=>{c(u[f])})}return c(e),c(t),i}var vr,Gn,Ar,Kn,Rr,Er,$e,_r,Hn,Tt,U,Pr,xr,Ir,Nr,Cr,Ot,jt,zn,kr,Mr,Xn,Qn,Lr,Dr,Zn,ue,er,Ur,Fr,vt,te,tr,nr,$r,jr,Yr,Wr,Vr,Br,He,Yt,Z,qr,de,Jr,Gr,ht,rr,Kr,Wt,At,Hr,zr,Xr,Qr,Zr,ei,ti,ni,ri,ir,ii,oi,Vt,Bt,si,or,ai,qt,li,ci,sr,Jt,pi,je,ui,di,fi,hi,Rt,mi,yi,gi,ar,lr,Le,ds,fs,hs,ms,ys,gs,Ss,ws,bs,Ts,Os,vs,Si,wi,Et,Xe,Oe,bi,Ti,As=w({"src/shared.js"(){vr=Object.create,Gn=Object.defineProperty,Ar=Object.getOwnPropertyDescriptor,Kn=Object.getOwnPropertyNames,Rr=Object.getPrototypeOf,Er=Object.prototype.hasOwnProperty,$e=(e,t)=>function(){return t||(0,e[Kn(e)[0]])((t={exports:{}}).exports,t),t.exports},_r=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Kn(t))!Er.call(e,u)&&u!==i&&Gn(e,u,{get:()=>t[u],enumerable:!(c=Ar(t,u))||c.enumerable});return e},Hn=(e,t,i)=>(i=e!=null?vr(Rr(e)):{},_r(t||!e||!e.__esModule?Gn(i,"default",{value:e,enumerable:!0}):i,e)),Tt=$e({"node_modules/ret/lib/types.js"(e,t){t.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}}}),U=$e({"node_modules/ret/lib/sets.js"(e){var t=Tt(),i=()=>[{type:t.RANGE,from:48,to:57}],c=()=>[{type:t.CHAR,value:95},{type:t.RANGE,from:97,to:122},{type:t.RANGE,from:65,to:90}].concat(i()),u=()=>[{type:t.CHAR,value:9},{type:t.CHAR,value:10},{type:t.CHAR,value:11},{type:t.CHAR,value:12},{type:t.CHAR,value:13},{type:t.CHAR,value:32},{type:t.CHAR,value:160},{type:t.CHAR,value:5760},{type:t.RANGE,from:8192,to:8202},{type:t.CHAR,value:8232},{type:t.CHAR,value:8233},{type:t.CHAR,value:8239},{type:t.CHAR,value:8287},{type:t.CHAR,value:12288},{type:t.CHAR,value:65279}],h=()=>[{type:t.CHAR,value:10},{type:t.CHAR,value:13},{type:t.CHAR,value:8232},{type:t.CHAR,value:8233}];e.words=()=>({type:t.SET,set:c(),not:!1}),e.notWords=()=>({type:t.SET,set:c(),not:!0}),e.ints=()=>({type:t.SET,set:i(),not:!1}),e.notInts=()=>({type:t.SET,set:i(),not:!0}),e.whitespace=()=>({type:t.SET,set:u(),not:!1}),e.notWhitespace=()=>({type:t.SET,set:u(),not:!0}),e.anyChar=()=>({type:t.SET,set:h(),not:!0})}}),Pr=$e({"node_modules/ret/lib/util.js"(e){var t=Tt(),i=U(),c="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",u={0:0,t:9,n:10,v:11,f:12,r:13};e.strToChars=h=>{var f=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return h=h.replace(f,(O,D,T,$,R,J,W,ae)=>{if(T)return O;var Q=D?8:$?parseInt($,16):R?parseInt(R,16):J?parseInt(J,8):W?c.indexOf(W):u[ae],ne=String.fromCharCode(Q);return/[[\]{}^$.|?*+()]/.test(ne)&&(ne="\\"+ne),ne}),h},e.tokenizeClass=(h,f)=>{for(var O=[],D=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,T,$;(T=D.exec(h))!=null;)if(T[1])O.push(i.words());else if(T[2])O.push(i.ints());else if(T[3])O.push(i.whitespace());else if(T[4])O.push(i.notWords());else if(T[5])O.push(i.notInts());else if(T[6])O.push(i.notWhitespace());else if(T[7])O.push({type:t.RANGE,from:(T[8]||T[9]).charCodeAt(0),to:T[10].charCodeAt(0)});else if($=T[12])O.push({type:t.CHAR,value:$.charCodeAt(0)});else return[O,D.lastIndex];e.error(f,"Unterminated character class")},e.error=(h,f)=>{throw new SyntaxError("Invalid regular expression: /"+h+"/: "+f)}}}),xr=$e({"node_modules/ret/lib/positions.js"(e){var t=Tt();e.wordBoundary=()=>({type:t.POSITION,value:"b"}),e.nonWordBoundary=()=>({type:t.POSITION,value:"B"}),e.begin=()=>({type:t.POSITION,value:"^"}),e.end=()=>({type:t.POSITION,value:"$"})}}),Ir=$e({"node_modules/ret/lib/index.js"(e,t){var i=Pr(),c=Tt(),u=U(),h=xr();t.exports=f=>{var O=0,D,T,$={type:c.ROOT,stack:[]},R=$,J=$.stack,W=[],ae=x=>{i.error(f,`Nothing to repeat at column ${x-1}`)},Q=i.strToChars(f);for(D=Q.length;O<D;)switch(T=Q[O++],T){case"\\":switch(T=Q[O++],T){case"b":J.push(h.wordBoundary());break;case"B":J.push(h.nonWordBoundary());break;case"w":J.push(u.words());break;case"W":J.push(u.notWords());break;case"d":J.push(u.ints());break;case"D":J.push(u.notInts());break;case"s":J.push(u.whitespace());break;case"S":J.push(u.notWhitespace());break;default:/\d/.test(T)?J.push({type:c.REFERENCE,value:parseInt(T,10)}):J.push({type:c.CHAR,value:T.charCodeAt(0)})}break;case"^":J.push(h.begin());break;case"$":J.push(h.end());break;case"[":{var ne;Q[O]==="^"?(ne=!0,O++):ne=!1;var he=i.tokenizeClass(Q.slice(O),f);O+=he[1],J.push({type:c.SET,set:he[0],not:ne});break}case".":J.push(u.anyChar());break;case"(":{var ye={type:c.GROUP,stack:[],remember:!0};T=Q[O],T==="?"&&(T=Q[O+1],O+=2,T==="="?ye.followedBy=!0:T==="!"?ye.notFollowedBy=!0:T!==":"&&i.error(f,`Invalid group, character '${T}' after '?' at column ${O-1}`),ye.remember=!1),J.push(ye),W.push(R),R=ye,J=ye.stack;break}case")":W.length===0&&i.error(f,`Unmatched ) at column ${O-1}`),R=W.pop(),J=R.options?R.options[R.options.length-1]:R.stack;break;case"|":{R.options||(R.options=[R.stack],delete R.stack);var j=[];R.options.push(j),J=j;break}case"{":{var S=/^(\d+)(,(\d+)?)?\}/.exec(Q.slice(O)),b,_;S!==null?(J.length===0&&ae(O),b=parseInt(S[1],10),_=S[2]?S[3]?parseInt(S[3],10):1/0:b,O+=S[0].length,J.push({type:c.REPETITION,min:b,max:_,value:J.pop()})):J.push({type:c.CHAR,value:123});break}case"?":J.length===0&&ae(O),J.push({type:c.REPETITION,min:0,max:1,value:J.pop()});break;case"+":J.length===0&&ae(O),J.push({type:c.REPETITION,min:1,max:1/0,value:J.pop()});break;case"*":J.length===0&&ae(O),J.push({type:c.REPETITION,min:0,max:1/0,value:J.pop()});break;default:J.push({type:c.CHAR,value:T.charCodeAt(0)})}return W.length!==0&&i.error(f,"Unterminated group"),$},t.exports.types=c}}),Nr=$e({"node_modules/drange/lib/index.js"(e,t){var i=class gt{constructor(h,f){this.low=h,this.high=f,this.length=1+f-h}overlaps(h){return!(this.high<h.low||this.low>h.high)}touches(h){return!(this.high+1<h.low||this.low-1>h.high)}add(h){return new gt(Math.min(this.low,h.low),Math.max(this.high,h.high))}subtract(h){return h.low<=this.low&&h.high>=this.high?[]:h.low>this.low&&h.high<this.high?[new gt(this.low,h.low-1),new gt(h.high+1,this.high)]:h.low<=this.low?[new gt(h.high+1,this.high)]:[new gt(this.low,h.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},c=class Lt{constructor(h,f){this.ranges=[],this.length=0,h!=null&&this.add(h,f)}_update_length(){this.length=this.ranges.reduce((h,f)=>h+f.length,0)}add(h,f){var O=D=>{for(var T=0;T<this.ranges.length&&!D.touches(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&D.touches(this.ranges[T]);)D=D.add(this.ranges[T]),T++;$.push(D),this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return h instanceof Lt?h.ranges.forEach(O):(f==null&&(f=h),O(new i(h,f))),this}subtract(h,f){var O=D=>{for(var T=0;T<this.ranges.length&&!D.overlaps(this.ranges[T]);)T++;for(var $=this.ranges.slice(0,T);T<this.ranges.length&&D.overlaps(this.ranges[T]);)$=$.concat(this.ranges[T].subtract(D)),T++;this.ranges=$.concat(this.ranges.slice(T)),this._update_length()};return h instanceof Lt?h.ranges.forEach(O):(f==null&&(f=h),O(new i(h,f))),this}intersect(h,f){var O=[],D=T=>{for(var $=0;$<this.ranges.length&&!T.overlaps(this.ranges[$]);)$++;for(;$<this.ranges.length&&T.overlaps(this.ranges[$]);){var R=Math.max(this.ranges[$].low,T.low),J=Math.min(this.ranges[$].high,T.high);O.push(new i(R,J)),$++}};return h instanceof Lt?h.ranges.forEach(D):(f==null&&(f=h),D(new i(h,f))),this.ranges=O,this._update_length(),this}index(h){for(var f=0;f<this.ranges.length&&this.ranges[f].length<=h;)h-=this.ranges[f].length,f++;return this.ranges[f].low+h}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new Lt(this)}numbers(){return this.ranges.reduce((h,f)=>{for(var O=f.low;O<=f.high;)h.push(O),O++;return h},[])}subranges(){return this.ranges.map(h=>({low:h.low,high:h.high,length:1+h.high-h.low}))}};t.exports=c}}),Cr=$e({"node_modules/randexp/lib/randexp.js"(e,t){var i=Ir(),c=Nr(),u=i.types;t.exports=class Dt{constructor(f,O){if(this._setDefaults(f),f instanceof RegExp)this.ignoreCase=f.ignoreCase,this.multiline=f.multiline,f=f.source;else if(typeof f=="string")this.ignoreCase=O&&O.indexOf("i")!==-1,this.multiline=O&&O.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=i(f)}_setDefaults(f){this.max=f.max!=null?f.max:Dt.prototype.max!=null?Dt.prototype.max:100,this.defaultRange=f.defaultRange?f.defaultRange:this.defaultRange.clone(),f.randInt&&(this.randInt=f.randInt)}gen(){return this._gen(this.tokens,[])}_gen(f,O){var D,T,$,R,J;switch(f.type){case u.ROOT:case u.GROUP:if(f.followedBy||f.notFollowedBy)return"";for(f.remember&&f.groupNumber===void 0&&(f.groupNumber=O.push(null)-1),D=f.options?this._randSelect(f.options):f.stack,T="",R=0,J=D.length;R<J;R++)T+=this._gen(D[R],O);return f.remember&&(O[f.groupNumber]=T),T;case u.POSITION:return"";case u.SET:{var W=this._expand(f);return W.length?String.fromCharCode(this._randSelect(W)):""}case u.REPETITION:for($=this.randInt(f.min,f.max===1/0?f.min+this.max:f.max),T="",R=0;R<$;R++)T+=this._gen(f.value,O);return T;case u.REFERENCE:return O[f.value-1]||"";case u.CHAR:{var ae=this.ignoreCase&&this._randBool()?this._toOtherCase(f.value):f.value;return String.fromCharCode(ae)}}}_toOtherCase(f){return f+(97<=f&&f<=122?-32:65<=f&&f<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(f){return f instanceof c?f.index(this.randInt(0,f.length-1)):f[this.randInt(0,f.length-1)]}_expand(f){if(f.type===i.types.CHAR)return new c(f.value);if(f.type===i.types.RANGE)return new c(f.from,f.to);{let O=new c;for(let D=0;D<f.set.length;D++){let T=this._expand(f.set[D]);if(O.add(T),this.ignoreCase)for(let $=0;$<T.length;$++){let R=T.index($),J=this._toOtherCase(R);R!==J&&O.add(J)}}return f.not?this.defaultRange.clone().subtract(O):this.defaultRange.clone().intersect(O)}}randInt(f,O){return f+Math.floor(Math.random()*(1+O-f))}get defaultRange(){return this._range=this._range||new c(32,126)}set defaultRange(f){this._range=f}static randexp(f,O){var D;return typeof f=="string"&&(f=new RegExp(f,O)),f._randexp===void 0?(D=new Dt(f,O),f._randexp=D):(D=f._randexp,D._setDefaults(f)),D.gen()}static sugar(){RegExp.prototype.gen=function(){return Dt.randexp(this)}}}}}),Ot=$e({"node_modules/yaml/dist/PlainValue-ec8e588e.js"(e){var t={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},i={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"},c="tag:yaml.org,2002:",u={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function h(j){let S=[0],b=j.indexOf(` `);for(;b!==-1;)b+=1,S.push(b),b=j.indexOf(` `,b);return S}function f(j){let S,b;return typeof j=="string"?(S=h(j),b=j):(Array.isArray(j)&&(j=j[0]),j&&j.context&&(j.lineStarts||(j.lineStarts=h(j.context.src)),S=j.lineStarts,b=j.context.src)),{lineStarts:S,src:b}}function O(j,S){if(typeof j!="number"||j<0)return null;let{lineStarts:b,src:_}=f(S);if(!b||!_||j>_.length)return null;for(let M=0;M<b.length;++M){let E=b[M];if(j<E)return{line:M,col:j-b[M-1]+1};if(j===E)return{line:M+1,col:1}}let x=b.length;return{line:x,col:j-b[x-1]+1}}function D(j,S){let{lineStarts:b,src:_}=f(S);if(!b||!(j>=1)||j>b.length)return null;let x=b[j-1],M=b[j];for(;M&&M>x&&_[M-1]===` `;)--M;return _.slice(x,M)}function T({start:j,end:S},b,_=80){let x=D(j.line,b);if(!x)return null;let{col:M}=j;if(x.length>_)if(M<=_-10)x=x.substr(0,_-1)+"\u2026";else{let G=Math.round(_/2);x.length>M+G&&(x=x.substr(0,M+G-1)+"\u2026"),M-=x.length-_,x="\u2026"+x.substr(1-_)}let E=1,I="";S&&(S.line===j.line&&M+(S.col-j.col)<=_+1?E=S.col-j.col:(E=Math.min(x.length+1,_)-M,I="\u2026"));let C=M>1?" ".repeat(M-1):"",V="^".repeat(E);return`${x} ${C}${V}${I}`}var $=class Ri{static copy(S){return new Ri(S.start,S.end)}constructor(S,b){this.start=S,this.end=b||S}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(S,b){let{start:_,end:x}=this;if(S.length===0||x<=S[0])return this.origStart=_,this.origEnd=x,b;let M=b;for(;M<S.length&&!(S[M]>_);)++M;this.origStart=_+M;let E=M;for(;M<S.length&&!(S[M]>=x);)++M;return this.origEnd=x+M,E}},R=class nt{static addStringTerminator(S,b,_){if(_[_.length-1]===` `)return _;let x=nt.endOfWhiteSpace(S,b);return x>=S.length||S[x]===` `?_+` `:_}static atDocumentBoundary(S,b,_){let x=S[b];if(!x)return!0;let M=S[b-1];if(M&&M!==` `)return!1;if(_){if(x!==_)return!1}else if(x!==t.DIRECTIVES_END&&x!==t.DOCUMENT_END)return!1;let E=S[b+1],I=S[b+2];if(E!==x||I!==x)return!1;let C=S[b+3];return!C||C===` `||C===" "||C===" "}static endOfIdentifier(S,b){let _=S[b],x=_==="<",M=x?[` `," "," ",">"]:[` `," "," ","[","]","{","}",","];for(;_&&M.indexOf(_)===-1;)_=S[b+=1];return x&&_===">"&&(b+=1),b}static endOfIndent(S,b){let _=S[b];for(;_===" ";)_=S[b+=1];return b}static endOfLine(S,b){let _=S[b];for(;_&&_!==` `;)_=S[b+=1];return b}static endOfWhiteSpace(S,b){let _=S[b];for(;_===" "||_===" ";)_=S[b+=1];return b}static startOfLine(S,b){let _=S[b-1];if(_===` `)return b;for(;_&&_!==` `;)_=S[b-=1];return b+1}static endOfBlockIndent(S,b,_){let x=nt.endOfIndent(S,_);if(x>_+b)return x;{let M=nt.endOfWhiteSpace(S,x),E=S[M];if(!E||E===` `)return M}return null}static atBlank(S,b,_){let x=S[b];return x===` `||x===" "||x===" "||_&&!x}static nextNodeIsIndented(S,b,_){return!S||b<0?!1:b>0?!0:_&&S==="-"}static normalizeOffset(S,b){let _=S[b];return _?_!==` `&&S[b-1]===` `?b-1:nt.endOfWhiteSpace(S,b):b}static foldNewline(S,b,_){let x=0,M=!1,E="",I=S[b+1];for(;I===" "||I===" "||I===` `;){switch(I){case` `:x=0,b+=1,E+=` `;break;case" ":x<=_&&(M=!0),b=nt.endOfWhiteSpace(S,b+2)-1;break;case" ":x+=1,b+=1;break}I=S[b+1]}return E||(E=" "),I&&x<=_&&(M=!0),{fold:E,offset:b,error:M}}constructor(S,b,_){Object.defineProperty(this,"context",{value:_||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=b||[],this.type=S,this.value=null}getPropValue(S,b,_){if(!this.context)return null;let{src:x}=this.context,M=this.props[S];return M&&x[M.start]===b?x.slice(M.start+(_?1:0),M.end):null}get anchor(){for(let S=0;S<this.props.length;++S){let b=this.getPropValue(S,t.ANCHOR,!0);if(b!=null)return b}return null}get comment(){let S=[];for(let b=0;b<this.props.length;++b){let _=this.getPropValue(b,t.COMMENT,!0);_!=null&&S.push(_)}return S.length>0?S.join(` `):null}commentHasRequiredWhitespace(S){let{src:b}=this.context;if(this.header&&S===this.header.end||!this.valueRange)return!1;let{end:_}=this.valueRange;return S!==_||nt.atBlank(b,_-1)}get hasComment(){if(this.context){let{src:S}=this.context;for(let b=0;b<this.props.length;++b)if(S[this.props[b].start]===t.COMMENT)return!0}return!1}get hasProps(){if(this.context){let{src:S}=this.context;for(let b=0;b<this.props.length;++b)if(S[this.props[b].start]!==t.COMMENT)return!0}return!1}get includesTrailingLines(){return!1}get jsonLike(){return[i.FLOW_MAP,i.FLOW_SEQ,i.QUOTE_DOUBLE,i.QUOTE_SINGLE].indexOf(this.type)!==-1}get rangeAsLinePos(){if(!this.range||!this.context)return;let S=O(this.range.start,this.context.root);if(!S)return;let b=O(this.range.end,this.context.root);return{start:S,end:b}}get rawValue(){if(!this.valueRange||!this.context)return null;let{start:S,end:b}=this.valueRange;return this.context.src.slice(S,b)}get tag(){for(let S=0;S<this.props.length;++S){let b=this.getPropValue(S,t.TAG,!1);if(b!=null){if(b[1]==="<")return{verbatim:b.slice(2,-1)};{let[_,x,M]=b.match(/^(.*!)([^!]*)$/);return{handle:x,suffix:M}}}}return null}get valueRangeContainsNewline(){if(!this.valueRange||!this.context)return!1;let{start:S,end:b}=this.valueRange,{src:_}=this.context;for(let x=S;x<b;++x)if(_[x]===` `)return!0;return!1}parseComment(S){let{src:b}=this.context;if(b[S]===t.COMMENT){let _=nt.endOfLine(b,S+1),x=new $(S,_);return this.props.push(x),_}return S}setOrigRanges(S,b){return this.range&&(b=this.range.setOrigRange(S,b)),this.valueRange&&this.valueRange.setOrigRange(S,b),this.props.forEach(_=>_.setOrigRange(S,b)),b}toString(){let{context:{src:S},range:b,value:_}=this;if(_!=null)return _;let x=S.slice(b.start,b.end);return nt.addStringTerminator(S,b.end,x)}},J=class extends Error{constructor(j,S,b){if(!b||!(S instanceof R))throw new Error(`Invalid arguments for new ${j}`);super(),this.name=j,this.message=b,this.source=S}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let j=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new $(this.offset,this.offset+1);let S=j&&O(this.offset,j);if(S){let b={line:S.line,col:S.col+1};this.linePos={start:S,end:b}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:S,col:b}=this.linePos.start;this.message+=` at line ${S}, column ${b}`;let _=j&&T(this.linePos,j);_&&(this.message+=`: ${_} `)}delete this.source}},W=class extends J{constructor(j,S){super("YAMLReferenceError",j,S)}},ae=class extends J{constructor(j,S){super("YAMLSemanticError",j,S)}},Q=class extends J{constructor(j,S){super("YAMLSyntaxError",j,S)}},ne=class extends J{constructor(j,S){super("YAMLWarning",j,S)}};function he(j,S,b){return S in j?Object.defineProperty(j,S,{value:b,enumerable:!0,configurable:!0,writable:!0}):j[S]=b,j}var ye=class ur extends R{static endOfLine(S,b,_){let x=S[b],M=b;for(;x&&x!==` `&&!(_&&(x==="["||x==="]"||x==="{"||x==="}"||x===","));){let E=S[M+1];if(x===":"&&(!E||E===` `||E===" "||E===" "||_&&E===",")||(x===" "||x===" ")&&E==="#")break;M+=1,x=E}return M}get strValue(){if(!this.valueRange||!this.context)return null;let{start:S,end:b}=this.valueRange,{src:_}=this.context,x=_[b-1];for(;S<b&&(x===` `||x===" "||x===" ");)x=_[--b-1];let M="";for(let I=S;I<b;++I){let C=_[I];if(C===` `){let{fold:V,offset:G}=R.foldNewline(_,I,-1);M+=V,I=G}else if(C