@telia-ace/alliance-cli 4.0.0-next.4 → 4.0.0-next.6
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/build-B7JNCB5Q.js +402 -0
- package/dist/chunk-MJYEZ65F.js +8 -0
- package/dist/chunk-SQJLD7IF.js +32 -0
- package/dist/index.js +1 -1
- package/dist/{jwt-63BXU2GA.js → jwt-ARROXAEA.js} +1 -1
- package/dist/prompt-KI4FQCI3.js +47 -0
- package/dist/{public-key-PRKWBUJ7.js → public-key-GRPF4KHS.js} +1 -1
- package/dist/{serve-DU72MF5O.js → serve-4CGYCEYF.js} +1 -1
- package/dist/upgrade-P3X5DB22.js +4 -0
- package/package.json +6 -6
- package/dist/build-OOIQVG5V.js +0 -402
- package/dist/chunk-PTAOP3HK.js +0 -32
- package/dist/chunk-X62RPJPI.js +0 -8
- package/dist/prompt-ZH6TPIKX.js +0 -47
- package/dist/upgrade-XXVWWXAA.js +0 -4
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as c__createRequire } from 'node:module';
|
|
2
|
+
const require = c__createRequire(import.meta.url);
|
|
3
|
+
import{a as $,b as Ne,c as P}from"./chunk-SQJLD7IF.js";import{d as ot}from"./chunk-MCRDX3J3.js";import{existsSync as z,readFileSync as at}from"fs";import{relative as je,resolve as D}from"path";var g={};ot(g,{BRAND:()=>Rt,DIRTY:()=>q,EMPTY_PATH:()=>lt,INVALID:()=>h,NEVER:()=>yr,OK:()=>k,ParseStatus:()=>b,Schema:()=>v,ZodAny:()=>W,ZodArray:()=>V,ZodBigInt:()=>Y,ZodBoolean:()=>G,ZodBranded:()=>_e,ZodCatch:()=>oe,ZodDate:()=>K,ZodDefault:()=>ie,ZodDiscriminatedUnion:()=>Ae,ZodEffects:()=>j,ZodEnum:()=>ne,ZodError:()=>w,ZodFirstPartyTypeKind:()=>m,ZodFunction:()=>Se,ZodIntersection:()=>te,ZodIssueCode:()=>c,ZodLazy:()=>re,ZodLiteral:()=>se,ZodMap:()=>me,ZodNaN:()=>ye,ZodNativeEnum:()=>ae,ZodNever:()=>O,ZodNull:()=>X,ZodNullable:()=>R,ZodNumber:()=>H,ZodObject:()=>T,ZodOptional:()=>C,ZodParsedType:()=>u,ZodPipeline:()=>xe,ZodPromise:()=>B,ZodReadonly:()=>ce,ZodRecord:()=>Ce,ZodSchema:()=>v,ZodSet:()=>ge,ZodString:()=>U,ZodSymbol:()=>pe,ZodTransformer:()=>j,ZodTuple:()=>E,ZodType:()=>v,ZodUndefined:()=>Q,ZodUnion:()=>ee,ZodUnknown:()=>L,ZodVoid:()=>he,addIssueToContext:()=>d,any:()=>Ft,array:()=>Jt,bigint:()=>Zt,boolean:()=>Ge,coerce:()=>gr,custom:()=>qe,date:()=>Lt,datetimeRegex:()=>Be,defaultErrorMap:()=>M,discriminatedUnion:()=>Gt,effect:()=>cr,enum:()=>ar,function:()=>rr,getErrorMap:()=>ue,getParsedType:()=>I,instanceof:()=>Pt,intersection:()=>Kt,isAborted:()=>we,isAsync:()=>le,isDirty:()=>Te,isValid:()=>F,late:()=>$t,lazy:()=>sr,literal:()=>nr,makeIssue:()=>ve,map:()=>er,nan:()=>Mt,nativeEnum:()=>ir,never:()=>Wt,null:()=>Dt,nullable:()=>ur,number:()=>Ye,object:()=>qt,objectUtil:()=>Ie,oboolean:()=>mr,onumber:()=>hr,optional:()=>dr,ostring:()=>pr,pipeline:()=>fr,preprocess:()=>lr,promise:()=>or,quotelessJson:()=>ct,record:()=>Xt,set:()=>tr,setErrorMap:()=>ut,strictObject:()=>Ht,string:()=>He,symbol:()=>Vt,transformer:()=>cr,tuple:()=>Qt,undefined:()=>zt,union:()=>Yt,unknown:()=>Ut,util:()=>_,void:()=>Bt});var _;(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let a={};for(let i of n)a[i]=i;return a},t.getValidEnumValues=n=>{let a=t.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(let o of a)i[o]=n[o];return t.objectValues(i)},t.objectValues=n=>t.objectKeys(n).map(function(a){return n[a]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let a=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},t.find=(n,a)=>{for(let i of n)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=s,t.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(_||(_={}));var Ie;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Ie||(Ie={}));var u=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),I=t=>{switch(typeof t){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(t)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(t)?u.array:t===null?u.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?u.promise:typeof Map<"u"&&t instanceof Map?u.map:typeof Set<"u"&&t instanceof Set?u.set:typeof Date<"u"&&t instanceof Date?u.date:u.object;default:return u.unknown}};var c=_.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ct=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),w=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(a){return a.message},s={_errors:[]},n=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(r(i));else{let o=s,f=0;for(;f<i.path.length;){let l=i.path[f];f===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(r(i))):o[l]=o[l]||{_errors:[]},o=o[l],f++}}};return n(this),s}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},s=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}};w.create=t=>new w(t);var dt=(t,e)=>{let r;switch(t.code){case c.invalid_type:t.received===u.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case c.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,_.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:r=`Unrecognized key(s) in object: ${_.joinValues(t.keys,", ")}`;break;case c.invalid_union:r="Invalid input";break;case c.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${_.joinValues(t.options)}`;break;case c.invalid_enum_value:r=`Invalid enum value. Expected ${_.joinValues(t.options)}, received '${t.received}'`;break;case c.invalid_arguments:r="Invalid function arguments";break;case c.invalid_return_type:r="Invalid function return type";break;case c.invalid_date:r="Invalid date";break;case c.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:_.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case c.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case c.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case c.custom:r="Invalid input";break;case c.invalid_intersection_types:r="Intersection results could not be merged";break;case c.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case c.not_finite:r="Number must be finite";break;default:r=e.defaultError,_.assertNever(t)}return{message:r}},M=dt;var ze=M;function ut(t){ze=t}function ue(){return ze}var ve=t=>{let{data:e,path:r,errorMaps:s,issueData:n}=t,a=[...r,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="",f=s.filter(l=>!!l).slice().reverse();for(let l of f)o=l(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}},lt=[];function d(t,e){let r=ue(),s=ve({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===M?void 0:M].filter(n=>!!n)});t.common.issues.push(s)}var b=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let s=[];for(let n of r){if(n.status==="aborted")return h;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,r){let s=[];for(let n of r){let a=await n.key,i=await n.value;s.push({key:a,value:i})}return t.mergeObjectSync(e,s)}static mergeObjectSync(e,r){let s={};for(let n of r){let{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return h;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}},h=Object.freeze({status:"aborted"}),q=t=>({status:"dirty",value:t}),k=t=>({status:"valid",value:t}),we=t=>t.status==="aborted",Te=t=>t.status==="dirty",F=t=>t.status==="valid",le=t=>typeof Promise<"u"&&t instanceof Promise;var p;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(p||(p={}));var S=class{constructor(e,r,s,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=s,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},De=(t,e)=>{if(F(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new w(t.common.issues);return this._error=r,this._error}}};function y(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:s,description:n}=t;if(e&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{let{message:f}=t;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:f??s??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:f??r??o.defaultError}},description:n}}var v=class{get description(){return this._def.description}_getType(e){return I(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:I(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new b,ctx:{common:e.parent.common,data:e.data,parsedType:I(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(le(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let s=this.safeParse(e,r);if(s.success)return s.data;throw s.error}safeParse(e,r){let s={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:I(e)},n=this._parseSync({data:e,path:s.path,parent:s});return De(s,n)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:I(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:r});return F(s)?{value:s.value}:{issues:r.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(s=>F(s)?{value:s.value}:{issues:r.common.issues})}async parseAsync(e,r){let s=await this.safeParseAsync(e,r);if(s.success)return s.data;throw s.error}async safeParseAsync(e,r){let s={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:I(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(le(n)?n:Promise.resolve(n));return De(s,a)}refine(e,r){let s=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,a)=>{let i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof r=="function"?r(s,n):r),!1))}_refinement(e){return new j({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return C.create(this,this._def)}nullable(){return R.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return V.create(this)}promise(){return B.create(this,this._def)}or(e){return ee.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new j({...y(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new ie({...y(this._def),innerType:this,defaultValue:r,typeName:m.ZodDefault})}brand(){return new _e({typeName:m.ZodBranded,type:this,...y(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new oe({...y(this._def),innerType:this,catchValue:r,typeName:m.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return xe.create(this,e)}readonly(){return ce.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ft=/^c[^\s-]{8,}$/i,pt=/^[0-9a-z]+$/,ht=/^[0-9A-HJKMNP-TV-Z]{26}$/i,mt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,gt=/^[a-z0-9_-]{21}$/i,yt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,vt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_t=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,xt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ee,bt=/^(?:(?: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])$/,kt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,wt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Tt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,At=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ct=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ue="((\\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])))",St=new RegExp(`^${Ue}$`);function We(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function jt(t){return new RegExp(`^${We(t)}$`)}function Be(t){let e=`${Ue}T${We(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Ot(t,e){return!!((e==="v4"||!e)&&bt.test(t)||(e==="v6"||!e)&&wt.test(t))}function Nt(t,e){if(!yt.test(t))return!1;try{let[r]=t.split("."),s=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function It(t,e){return!!((e==="v4"||!e)&&kt.test(t)||(e==="v6"||!e)&&Tt.test(t))}var U=class t extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:u.string,received:a.parsedType}),h}let s=new b,n;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){let i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&d(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")_t.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Ee||(Ee=new RegExp(xt,"u")),Ee.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")mt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")gt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"nanoid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")ft.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")pt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")ht.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),d(n,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?Be(a).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?St.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?jt(a).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?vt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"duration",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Ot(e.data,a.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?Nt(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"jwt",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?It(e.data,a.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cidr",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?At.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?Ct.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64url",code:c.invalid_string,message:a.message}),s.dirty()):_.assertNever(a);return{status:s.value,value:e.data}}_regex(e,r,s){return this.refinement(n=>e.test(n),{validation:r,code:c.invalid_string,...p.errToObj(s)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...p.errToObj(e)})}url(e){return this._addCheck({kind:"url",...p.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...p.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...p.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...p.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...p.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...p.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...p.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...p.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...p.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...p.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...p.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...p.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...p.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...p.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...p.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...p.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...p.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...p.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...p.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...p.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...p.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...p.errToObj(r)})}nonempty(e){return this.min(1,p.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};U.create=t=>new U({checks:[],typeName:m.ZodString,coerce:t?.coerce??!1,...y(t)});function Et(t,e){let r=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=r>s?r:s,a=Number.parseInt(t.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}var H=class t extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:u.number,received:a.parsedType}),h}let s,n=new b;for(let a of this._def.checks)a.kind==="int"?_.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Et(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_finite,message:a.message}),n.dirty()):_.assertNever(a);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,p.toString(r))}gt(e,r){return this.setLimit("min",e,!1,p.toString(r))}lte(e,r){return this.setLimit("max",e,!0,p.toString(r))}lt(e,r){return this.setLimit("max",e,!1,p.toString(r))}setLimit(e,r,s,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:p.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:p.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:p.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:p.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:p.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:p.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(r)&&Number.isFinite(e)}};H.create=t=>new H({checks:[],typeName:m.ZodNumber,coerce:t?.coerce||!1,...y(t)});var Y=class t extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let s,n=new b;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):_.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return d(r,{code:c.invalid_type,expected:u.bigint,received:r.parsedType}),h}gte(e,r){return this.setLimit("min",e,!0,p.toString(r))}gt(e,r){return this.setLimit("min",e,!1,p.toString(r))}lte(e,r){return this.setLimit("max",e,!0,p.toString(r))}lt(e,r){return this.setLimit("max",e,!1,p.toString(r))}setLimit(e,r,s,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:p.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:p.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Y.create=t=>new Y({checks:[],typeName:m.ZodBigInt,coerce:t?.coerce??!1,...y(t)});var G=class extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.boolean,received:s.parsedType}),h}return k(e.data)}};G.create=t=>new G({typeName:m.ZodBoolean,coerce:t?.coerce||!1,...y(t)});var K=class t extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:u.date,received:a.parsedType}),h}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_date}),h}let s=new b,n;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):_.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:p.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:p.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};K.create=t=>new K({checks:[],coerce:t?.coerce||!1,typeName:m.ZodDate,...y(t)});var pe=class extends v{_parse(e){if(this._getType(e)!==u.symbol){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.symbol,received:s.parsedType}),h}return k(e.data)}};pe.create=t=>new pe({typeName:m.ZodSymbol,...y(t)});var Q=class extends v{_parse(e){if(this._getType(e)!==u.undefined){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.undefined,received:s.parsedType}),h}return k(e.data)}};Q.create=t=>new Q({typeName:m.ZodUndefined,...y(t)});var X=class extends v{_parse(e){if(this._getType(e)!==u.null){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.null,received:s.parsedType}),h}return k(e.data)}};X.create=t=>new X({typeName:m.ZodNull,...y(t)});var W=class extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return k(e.data)}};W.create=t=>new W({typeName:m.ZodAny,...y(t)});var L=class extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return k(e.data)}};L.create=t=>new L({typeName:m.ZodUnknown,...y(t)});var O=class extends v{_parse(e){let r=this._getOrReturnCtx(e);return d(r,{code:c.invalid_type,expected:u.never,received:r.parsedType}),h}};O.create=t=>new O({typeName:m.ZodNever,...y(t)});var he=class extends v{_parse(e){if(this._getType(e)!==u.undefined){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.void,received:s.parsedType}),h}return k(e.data)}};he.create=t=>new he({typeName:m.ZodVoid,...y(t)});var V=class t extends v{_parse(e){let{ctx:r,status:s}=this._processInputParams(e),n=this._def;if(r.parsedType!==u.array)return d(r,{code:c.invalid_type,expected:u.array,received:r.parsedType}),h;if(n.exactLength!==null){let i=r.data.length>n.exactLength.value,o=r.data.length<n.exactLength.value;(i||o)&&(d(r,{code:i?c.too_big:c.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(d(r,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(d(r,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>n.type._parseAsync(new S(r,i,r.path,o)))).then(i=>b.mergeArray(s,i));let a=[...r.data].map((i,o)=>n.type._parseSync(new S(r,i,r.path,o)));return b.mergeArray(s,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:p.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:p.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:p.toString(r)}})}nonempty(e){return this.min(1,e)}};V.create=(t,e)=>new V({type:t,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,...y(e)});function fe(t){if(t instanceof T){let e={};for(let r in t.shape){let s=t.shape[r];e[r]=C.create(fe(s))}return new T({...t._def,shape:()=>e})}else return t instanceof V?new V({...t._def,type:fe(t.element)}):t instanceof C?C.create(fe(t.unwrap())):t instanceof R?R.create(fe(t.unwrap())):t instanceof E?E.create(t.items.map(e=>fe(e))):t}var T=class t extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=_.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==u.object){let l=this._getOrReturnCtx(e);return d(l,{code:c.invalid_type,expected:u.object,received:l.parsedType}),h}let{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof O&&this._def.unknownKeys==="strip"))for(let l in n.data)i.includes(l)||o.push(l);let f=[];for(let l of i){let x=a[l],A=n.data[l];f.push({key:{status:"valid",value:l},value:x._parse(new S(n,A,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof O){let l=this._def.unknownKeys;if(l==="passthrough")for(let x of o)f.push({key:{status:"valid",value:x},value:{status:"valid",value:n.data[x]}});else if(l==="strict")o.length>0&&(d(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let x of o){let A=n.data[x];f.push({key:{status:"valid",value:x},value:l._parse(new S(n,A,n.path,x)),alwaysSet:x in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let l=[];for(let x of f){let A=await x.key,Ve=await x.value;l.push({key:A,value:Ve,alwaysSet:x.alwaysSet})}return l}).then(l=>b.mergeObjectSync(s,l)):b.mergeObjectSync(s,f)}get shape(){return this._def.shape()}strict(e){return p.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,s)=>{let n=this._def.errorMap?.(r,s).message??s.defaultError;return r.code==="unrecognized_keys"?{message:p.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let s of _.objectKeys(e))e[s]&&this.shape[s]&&(r[s]=this.shape[s]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let s of _.objectKeys(this.shape))e[s]||(r[s]=this.shape[s]);return new t({...this._def,shape:()=>r})}deepPartial(){return fe(this)}partial(e){let r={};for(let s of _.objectKeys(this.shape)){let n=this.shape[s];e&&!e[s]?r[s]=n:r[s]=n.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let s of _.objectKeys(this.shape))if(e&&!e[s])r[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof C;)a=a._def.innerType;r[s]=a}return new t({...this._def,shape:()=>r})}keyof(){return Je(_.objectKeys(this.shape))}};T.create=(t,e)=>new T({shape:()=>t,unknownKeys:"strip",catchall:O.create(),typeName:m.ZodObject,...y(e)});T.strictCreate=(t,e)=>new T({shape:()=>t,unknownKeys:"strict",catchall:O.create(),typeName:m.ZodObject,...y(e)});T.lazycreate=(t,e)=>new T({shape:t,unknownKeys:"strip",catchall:O.create(),typeName:m.ZodObject,...y(e)});var ee=class extends v{_parse(e){let{ctx:r}=this._processInputParams(e),s=this._def.options;function n(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(o=>new w(o.ctx.common.issues));return d(r,{code:c.invalid_union,unionErrors:i}),h}if(r.common.async)return Promise.all(s.map(async a=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(n);{let a,i=[];for(let f of s){let l={...r,common:{...r.common,issues:[]},parent:null},x=f._parseSync({data:r.data,path:r.path,parent:l});if(x.status==="valid")return x;x.status==="dirty"&&!a&&(a={result:x,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(f=>new w(f));return d(r,{code:c.invalid_union,unionErrors:o}),h}}get options(){return this._def.options}};ee.create=(t,e)=>new ee({options:t,typeName:m.ZodUnion,...y(e)});var Z=t=>t instanceof re?Z(t.schema):t instanceof j?Z(t.innerType()):t instanceof se?[t.value]:t instanceof ne?t.options:t instanceof ae?_.objectValues(t.enum):t instanceof ie?Z(t._def.innerType):t instanceof Q?[void 0]:t instanceof X?[null]:t instanceof C?[void 0,...Z(t.unwrap())]:t instanceof R?[null,...Z(t.unwrap())]:t instanceof _e||t instanceof ce?Z(t.unwrap()):t instanceof oe?Z(t._def.innerType):[],Ae=class t extends v{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==u.object)return d(r,{code:c.invalid_type,expected:u.object,received:r.parsedType}),h;let s=this.discriminator,n=r.data[s],a=this.optionsMap.get(n);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(d(r,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),h)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,s){let n=new Map;for(let a of r){let i=Z(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new t({typeName:m.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...y(s)})}};function Re(t,e){let r=I(t),s=I(e);if(t===e)return{valid:!0,data:t};if(r===u.object&&s===u.object){let n=_.objectKeys(e),a=_.objectKeys(t).filter(o=>n.indexOf(o)!==-1),i={...t,...e};for(let o of a){let f=Re(t[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(r===u.array&&s===u.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let a=0;a<t.length;a++){let i=t[a],o=e[a],f=Re(i,o);if(!f.valid)return{valid:!1};n.push(f.data)}return{valid:!0,data:n}}else return r===u.date&&s===u.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var te=class extends v{_parse(e){let{status:r,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(we(a)||we(i))return h;let o=Re(a.value,i.value);return o.valid?((Te(a)||Te(i))&&r.dirty(),{status:r.value,value:o.data}):(d(s,{code:c.invalid_intersection_types}),h)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};te.create=(t,e,r)=>new te({left:t,right:e,typeName:m.ZodIntersection,...y(r)});var E=class t extends v{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.array)return d(s,{code:c.invalid_type,expected:u.array,received:s.parsedType}),h;if(s.data.length<this._def.items.length)return d(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),h;!this._def.rest&&s.data.length>this._def.items.length&&(d(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...s.data].map((i,o)=>{let f=this._def.items[o]||this._def.rest;return f?f._parse(new S(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>b.mergeArray(r,i)):b.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};E.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new E({items:t,typeName:m.ZodTuple,rest:null,...y(e)})};var Ce=class t extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.object)return d(s,{code:c.invalid_type,expected:u.object,received:s.parsedType}),h;let n=[],a=this._def.keyType,i=this._def.valueType;for(let o in s.data)n.push({key:a._parse(new S(s,o,s.path,o)),value:i._parse(new S(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?b.mergeObjectAsync(r,n):b.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,s){return r instanceof v?new t({keyType:e,valueType:r,typeName:m.ZodRecord,...y(s)}):new t({keyType:U.create(),valueType:e,typeName:m.ZodRecord,...y(r)})}},me=class extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.map)return d(s,{code:c.invalid_type,expected:u.map,received:s.parsedType}),h;let n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,f],l)=>({key:n._parse(new S(s,o,s.path,[l,"key"])),value:a._parse(new S(s,f,s.path,[l,"value"]))}));if(s.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let f of i){let l=await f.key,x=await f.value;if(l.status==="aborted"||x.status==="aborted")return h;(l.status==="dirty"||x.status==="dirty")&&r.dirty(),o.set(l.value,x.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let f of i){let l=f.key,x=f.value;if(l.status==="aborted"||x.status==="aborted")return h;(l.status==="dirty"||x.status==="dirty")&&r.dirty(),o.set(l.value,x.value)}return{status:r.value,value:o}}}};me.create=(t,e,r)=>new me({valueType:e,keyType:t,typeName:m.ZodMap,...y(r)});var ge=class t extends v{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.set)return d(s,{code:c.invalid_type,expected:u.set,received:s.parsedType}),h;let n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(d(s,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(d(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let a=this._def.valueType;function i(f){let l=new Set;for(let x of f){if(x.status==="aborted")return h;x.status==="dirty"&&r.dirty(),l.add(x.value)}return{status:r.value,value:l}}let o=[...s.data.values()].map((f,l)=>a._parse(new S(s,f,s.path,l)));return s.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:p.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:p.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};ge.create=(t,e)=>new ge({valueType:t,minSize:null,maxSize:null,typeName:m.ZodSet,...y(e)});var Se=class t extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==u.function)return d(r,{code:c.invalid_type,expected:u.function,received:r.parsedType}),h;function s(o,f){return ve({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ue(),M].filter(l=>!!l),issueData:{code:c.invalid_arguments,argumentsError:f}})}function n(o,f){return ve({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ue(),M].filter(l=>!!l),issueData:{code:c.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof B){let o=this;return k(async function(...f){let l=new w([]),x=await o._def.args.parseAsync(f,a).catch(Oe=>{throw l.addIssue(s(f,Oe)),l}),A=await Reflect.apply(i,this,x);return await o._def.returns._def.type.parseAsync(A,a).catch(Oe=>{throw l.addIssue(n(A,Oe)),l})})}else{let o=this;return k(function(...f){let l=o._def.args.safeParse(f,a);if(!l.success)throw new w([s(f,l.error)]);let x=Reflect.apply(i,this,l.data),A=o._def.returns.safeParse(x,a);if(!A.success)throw new w([n(x,A.error)]);return A.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:E.create(e).rest(L.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,s){return new t({args:e||E.create([]).rest(L.create()),returns:r||L.create(),typeName:m.ZodFunction,...y(s)})}},re=class extends v{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};re.create=(t,e)=>new re({getter:t,typeName:m.ZodLazy,...y(e)});var se=class extends v{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return d(r,{received:r.data,code:c.invalid_literal,expected:this._def.value}),h}return{status:"valid",value:e.data}}get value(){return this._def.value}};se.create=(t,e)=>new se({value:t,typeName:m.ZodLiteral,...y(e)});function Je(t,e){return new ne({values:t,typeName:m.ZodEnum,...y(e)})}var ne=class t extends v{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),s=this._def.values;return d(r,{expected:_.joinValues(s),received:r.parsedType,code:c.invalid_type}),h}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),s=this._def.values;return d(r,{received:r.data,code:c.invalid_enum_value,options:s}),h}return k(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(s=>!e.includes(s)),{...this._def,...r})}};ne.create=Je;var ae=class extends v{_parse(e){let r=_.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==u.string&&s.parsedType!==u.number){let n=_.objectValues(r);return d(s,{expected:_.joinValues(n),received:s.parsedType,code:c.invalid_type}),h}if(this._cache||(this._cache=new Set(_.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=_.objectValues(r);return d(s,{received:s.data,code:c.invalid_enum_value,options:n}),h}return k(e.data)}get enum(){return this._def.values}};ae.create=(t,e)=>new ae({values:t,typeName:m.ZodNativeEnum,...y(e)});var B=class extends v{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==u.promise&&r.common.async===!1)return d(r,{code:c.invalid_type,expected:u.promise,received:r.parsedType}),h;let s=r.parsedType===u.promise?r.data:Promise.resolve(r.data);return k(s.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};B.create=(t,e)=>new B({type:t,typeName:m.ZodPromise,...y(e)});var j=class extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{d(s,i),i.fatal?r.abort():r.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return h;let f=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return f.status==="aborted"?h:f.status==="dirty"?q(f.value):r.value==="dirty"?q(f.value):f});{if(r.value==="aborted")return h;let o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?h:o.status==="dirty"?q(o.value):r.value==="dirty"?q(o.value):o}}if(n.type==="refinement"){let i=o=>{let f=n.refinement(o,a);if(s.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?h:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?h:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){let i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!F(i))return h;let o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>F(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:r.value,value:o})):h);_.assertNever(n)}};j.create=(t,e,r)=>new j({schema:t,typeName:m.ZodEffects,effect:e,...y(r)});j.createWithPreprocess=(t,e,r)=>new j({schema:e,effect:{type:"preprocess",transform:t},typeName:m.ZodEffects,...y(r)});var C=class extends v{_parse(e){return this._getType(e)===u.undefined?k(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};C.create=(t,e)=>new C({innerType:t,typeName:m.ZodOptional,...y(e)});var R=class extends v{_parse(e){return this._getType(e)===u.null?k(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};R.create=(t,e)=>new R({innerType:t,typeName:m.ZodNullable,...y(e)});var ie=class extends v{_parse(e){let{ctx:r}=this._processInputParams(e),s=r.data;return r.parsedType===u.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};ie.create=(t,e)=>new ie({innerType:t,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});var oe=class extends v{_parse(e){let{ctx:r}=this._processInputParams(e),s={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return le(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new w(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new w(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};oe.create=(t,e)=>new oe({innerType:t,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});var ye=class extends v{_parse(e){if(this._getType(e)!==u.nan){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.nan,received:s.parsedType}),h}return{status:"valid",value:e.data}}};ye.create=t=>new ye({typeName:m.ZodNaN,...y(t)});var Rt=Symbol("zod_brand"),_e=class extends v{_parse(e){let{ctx:r}=this._processInputParams(e),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}},xe=class t extends v{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?h:a.status==="dirty"?(r.dirty(),q(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{let n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?h:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,r){return new t({in:e,out:r,typeName:m.ZodPipeline})}},ce=class extends v{_parse(e){let r=this._def.innerType._parse(e),s=n=>(F(n)&&(n.value=Object.freeze(n.value)),n);return le(r)?r.then(n=>s(n)):s(r)}unwrap(){return this._def.innerType}};ce.create=(t,e)=>new ce({innerType:t,typeName:m.ZodReadonly,...y(e)});function Fe(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function qe(t,e={},r){return t?W.create().superRefine((s,n)=>{let a=t(s);if(a instanceof Promise)return a.then(i=>{if(!i){let o=Fe(e,s),f=o.fatal??r??!0;n.addIssue({code:"custom",...o,fatal:f})}});if(!a){let i=Fe(e,s),o=i.fatal??r??!0;n.addIssue({code:"custom",...i,fatal:o})}}):W.create()}var $t={object:T.lazycreate},m;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(m||(m={}));var Pt=(t,e={message:`Input not instance of ${t.name}`})=>qe(r=>r instanceof t,e),He=U.create,Ye=H.create,Mt=ye.create,Zt=Y.create,Ge=G.create,Lt=K.create,Vt=pe.create,zt=Q.create,Dt=X.create,Ft=W.create,Ut=L.create,Wt=O.create,Bt=he.create,Jt=V.create,qt=T.create,Ht=T.strictCreate,Yt=ee.create,Gt=Ae.create,Kt=te.create,Qt=E.create,Xt=Ce.create,er=me.create,tr=ge.create,rr=Se.create,sr=re.create,nr=se.create,ar=ne.create,ir=ae.create,or=B.create,cr=j.create,dr=C.create,ur=R.create,lr=j.createWithPreprocess,fr=xe.create,pr=()=>He().optional(),hr=()=>Ye().optional(),mr=()=>Ge().optional(),gr={string:t=>U.create({...t,coerce:!0}),number:t=>H.create({...t,coerce:!0}),boolean:t=>G.create({...t,coerce:!0}),bigint:t=>Y.create({...t,coerce:!0}),date:t=>K.create({...t,coerce:!0})};var yr=h;var vr=g.object({}),_r=g.object({alias:g.object({}).passthrough().default({}).describe("Equivalent to `vite.resolve.alias`.\n\nhttps://vitejs.dev/config/shared-options.html#resolve-alias"),plugins:g.any().array().default([]).describe("Equivalent to `vite.plugins`.\n\nhttps://vitejs.dev/config/shared-options.html#plugins")}),xr=g.object({server:g.number().default(3e3).describe("The port that the dev server should use."),gateway:g.number().default(3001).describe("The port that the api gateway should use.")}),br=g.object({apps:g.string().array().default([]).describe(`Additional apps to include.
|
|
4
|
+
|
|
5
|
+
Note: additional apps need to be added as devDependencies.`),ports:xr.default({}).describe("Options for ports."),open:g.boolean().default(!1).describe("Whether the dev server should automatically open in your browser or not."),logging:g.boolean().default(!1).describe("Whether the dev server and browser console should output more log information or not.")}),kr=g.object({mode:g.string().default("production").describe("Which mode to use when building the app. [production | development]"),watch:g.boolean().default(!1).describe("Whether the build should start watching and rebuild when files change or not.")}),wr=g.object({app:g.string().default("./src/app.ts").describe("The entry file for the app."),manifest:g.string().default("./src/manifest.json").describe("The entry file for the app manifest.")}),be=g.object({vite:_r.default({}).describe("Options related to Vite."),server:br.default({}).describe("Options related to the dev server."),entries:wr.default({}).describe("Options related to the app entry points."),build:kr.default({}).describe("Options related to app build."),experimental:vr.default({}).describe("Experimental options.")}),Tr=g.enum(["build","serve"]),Ar=g.object({command:Tr,mode:g.string()}),Cr=g.function().args(Ar).returns(be.or(g.promise(be))),Os=g.function().args(g.union([be,Cr]));var Sr=g.enum(["necessary","functional","analytics","marketing"]),jr=g.object({purpose:g.string().describe("Purpose of the storing the value."),category:Sr.describe("Category of the storage value - necessary, functional, analytics or marketing."),lifespan:g.string().describe("Basic description of how long the value will be stored.")}),Or=g.record(jr.describe("Key used when writing to the storage.")),Nr=g.object({value:g.string().describe("The localization token default value."),description:g.string().describe("The localization token description.")}),Ir=g.object({localization:g.record(Nr.describe("Key used when getting the localized text.")).default({}).describe("Translateable texts used in the app")}),Er=g.object({common:g.object({order:g.number().optional().describe("Order of the capability in the common capabilities list."),variant:g.enum(["primary","secondary","expressive","destructive","text","primary-white","secondary-white","expressive-white","tertiary-purple"]).default("secondary").describe("Variant of the capability button.")}).optional().describe("Common capability configuration."),label:g.string().optional().describe("Label for the capability.")}),Rr=g.object({name:g.string().describe("URL friendly name of the app."),endpoints:g.string().array().default([]).describe("Endpoints that should be communicated with using the API gateway."),permissions:g.string().array().default([]).describe("Permissions that can be added to user roles."),resources:Ir.default({}).describe("Resources used by the app."),storage:Or.default({}).describe("Cookies, session storage, and local storage values that are used by the app."),capabilities:g.record(Er.describe("Capability key.")).default({}).describe("Capabilities that the app has.")}).passthrough();function Ke(t,e){let r=Rr.safeParse(t);return r.success?r.data:Qe(r.error.format(),e?[e]:[]).join(`
|
|
6
|
+
`)}function Qe(t,e=[],r=""){t._errors?.length&&e.push(`${r} - ${t._errors.join(" + ")}`);for(let[s,n]of Object.entries(t))s==="_errors"||!n||typeof n!="object"||Array.isArray(n)||Qe(n,e,r?`${r}.${s}`:s);return e}function $e(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function Pe(t,e,r=".",s){if(!$e(e))return Pe(t,{},r,s);let n=Object.assign({},e);for(let a in t){if(a==="__proto__"||a==="constructor")continue;let i=t[a];i!=null&&(s&&s(n,a,i,r)||(Array.isArray(i)&&Array.isArray(n[a])?n[a]=[...i,...n[a]]:$e(i)&&$e(n[a])?n[a]=Pe(i,n[a],(r?`${r}.`:"")+a.toString(),s):n[a]=i))}return n}function Me(t){return(...e)=>e.reduce((r,s)=>Pe(r,s,"",t),{})}var Xe=Me(),Rs=Me((t,e,r)=>{if(t[e]!==void 0&&typeof r=="function")return t[e]=r(t[e]),!0}),$s=Me((t,e,r)=>{if(Array.isArray(t[e])&&typeof r=="function")return t[e]=r(t[e]),!0});var $r=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Pr=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Mr=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Zr(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){Lr(t);return}return e}function Lr(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function Ze(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);let r=t.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!Mr.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if($r.test(t)||Pr.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,Zr)}return JSON.parse(t)}catch(s){if(e.strict)throw s;return t}}import{createServer as Vr}from"net";import{networkInterfaces as zr}from"os";var Dr=new Set([1,7,9,11,13,15,17,19,20,21,22,23,25,37,42,43,53,69,77,79,87,95,101,102,103,104,109,110,111,113,115,117,119,123,135,137,139,143,161,179,389,427,465,512,513,514,515,526,530,531,532,540,548,554,556,563,587,601,636,989,990,993,995,1719,1720,1723,2049,3659,4045,5060,5061,6e3,6566,6665,6666,6667,6668,6669,6697,10080]);function Fr(t){return Dr.has(t)}function Ur(t){return!Fr(t)}function Wr(t,e){t&&console.log(`[get-port] ${e}`)}function et(t,e){return new Promise(r=>{let s=Vr();s.unref(),s.on("error",()=>{r(!1)}),s.listen({port:t,host:e},()=>{let{port:n}=s.address();s.close(()=>{r(Ur(n)&&n)})})})}function Br(t){let e=new Set(t);for(let r of Object.values(zr()))for(let s of r||[])s.address&&!s.internal&&!s.address.startsWith("fe80::")&&e.add(s.address);return[...e]}function Jr(t){return t?`on host ${JSON.stringify(t)}`:"on any host"}async function Le(t,e=process.env.HOST,r){if(e||(e=Br([void 0,"0.0.0.0"])),!Array.isArray(e))return et(t,e);for(let s of e){let n=await et(t,s);if(n===!1)return t<1024&&r&&Wr(r,`Unable to listen to the privileged port ${t} ${Jr(s)}`),!1;t===0&&n!==0&&(t=n)}return t}import{loadConfigFromFile as qr}from"vite";var N=$("yellow"),J=$("green"),tt=$("red"),rt=$("cyan"),ke=$("bold"),st=$("underline"),Gs=$("italic"),Ks=$("magentaBright"),it={"arg.build.watch":"Whether the build should start watching and rebuild when files change or not.","arg.config":"The path to the app configuration file.","arg.debug":"Whether to output debug information or not.","arg.entries.app":"The entry file for the app.","arg.entries.manifest":"The entry file for the app manifest.","arg.jwt.app":"Token app name.","arg.jwt.expiration":"Token expiration time compatible with https://npmjs.com/package/ms.","arg.jwt.user.email":"Token user email.","arg.jwt.user.firstName":"Token user first name.","arg.jwt.user.lastName":"Token user last name.","arg.jwt.user.permission":"Token user permission(s).","arg.jwt.user.sub":"Token user sub.","arg.jwt.workspace":"Token workspace name.","arg.jwt.organization":"Token organization name.","arg.mode":"Which mode to use when building the app.","arg.public-key.clean":"Whether to exclude the -----BEGIN PUBLIC KEY----- prefix and -----END PUBLIC KEY----- suffix or not.","arg.public-key.type":"Type of public key.","arg.serve.logging":"Whether the server and browser console should output more log information or not.","arg.serve.open":"Whether the server should automatically open in your browser or not.","arg.serve.ports.gateway":"The port that the gateway should use.","arg.serve.ports.server":"The port that the server should use.","arg.upgrade.next":"Whether or not the CLI should include the 'next' tag when upgrading @telia-ace packages.","changes.upgraded":`Upgraded ${N("'{{pkg}}'")} to ${J("'{{v}}'")}`,"command.build":"Builds an Alliance app.","command.jwt":"Creates an Alliance JWT.","command.public-key":"Creates a public key used to verify an Alliance JWT.","command.serve":"Starts the Alliance development server.","command.upgrade":"Upgrades Alliance app(s).","errors.invalid-manifest":"Invalid app manifest","errors.no-entry":"Could not find any app and/or manifest entry file at '{{app}}' or '{{manifest}}'","errors.npm-error":"Could not get upgrade information from NPM.","errors.port-busy":"Port {{busy}} is busy","info.gateway-url":`${ke("Gateway:")} ${st(rt("{{url}}"))}`,"info.header.changes":"Changes","info.header.recommendations":"Recommendations","info.header.warnings":"Warnings","info.next-steps":"Next steps:","info.server-url":`${ke("Server:")} ${st(rt("{{url}}"))}`,"info.steps.install":`Run ${N("'{{cmd}}'")} to install the changed package versions`,"info.steps.warnings":`Address the ${tt("warnings")} and ${N("recommendations")} detailed above`,"info.stop-server":ke("Press CTRL + C to stop the server."),"info.upgraded":`Upgraded ${N("'{{pkg}}'")} to ${J("'{{v}}'")}`,"recommendations.update.webprovisions-registry-app":`Remove ${N("'{{pkg}}'")} and install ${J("'{{wpPkg}}'")} (preferably as a dev dependency)`,"recommendations.update.webprovisions-registry-config":`Add ${N("'@webprovisions-registry:registry=https://registry.webprovisions.io'")} to the ${J("'.npmrc'")} file to always use the Webprovisions registry for Webprovisions packages`,"recommendations.add.webprovisions-registry-config":`Create a ${J("'.npmrc'")} file containing ${N("'@webprovisions-registry:registry=https://registry.webprovisions.io'")} to always use the Webprovisions registry for Webprovisions packages`,"recommendations.upgrade":`Upgrade ${N("'{{pkg}}'")} to ${J("'{{v}}'")}`,"warnings.set":`Set ${N("'{{property}}'")} to ${J("'{{new}}'")}`,"warnings.change":`Change ${N("'{{property}}'")} from ${tt("'{{current}}'")} to ${J("'{{new}}'")}`,"warnings.remove":`Remove ${N("'{{property}}'")}{{alt}}`},Qs=Object.keys(it);function de(t,e={}){return Object.entries(e).reduce((r,[s,n])=>r.replaceAll(`{{${s}}}`,String(n)),it[t]).trim()}var Xs={type:"string",description:de("arg.config"),required:!1,alias:"c",valueHint:"./alliance.config.ts"},en={type:"boolean",description:de("arg.debug"),required:!1,default:!1,alias:"d"};function tn({debug:t,input:e,output:r}){t&&(P.log(ke(Ne("cyan","Input:"))),console.log(JSON.stringify(e,null,2),`
|
|
7
|
+
`),P.log(ke(Ne("cyan","Output:")))),console.log(r,`
|
|
8
|
+
`)}var nt=["./src/app.ts","./src/app.js","./src/app.mts","./src/app.mjs","./src/app.cts","./src/app.cjs"],Hr=["alliance.config.js","alliance.config.mjs","alliance.config.ts","alliance.config.cjs","alliance.config.mts","alliance.config.cts","alliance.config.json"];async function Yr(t,e){let r;if(e?r=D(process.cwd(),e):r=Kr(),r&&z(r)){if(r.endsWith(".json"))return Ze(at(r).toString());try{return(await qr(t,r))?.config||{}}catch(s){P.error(s.message),process.exit(1)}}return{}}function Gr(t){let e=D(process.cwd(),t.app);if(t.manifest=D(process.cwd(),t.manifest),!nt.includes(t.app))return t.app=e,t;for(let r of nt){let s=D(process.cwd(),r);if(z(s)){t.app=s;break}}return t}function Kr(){let t=Hr.reduce((e,r)=>{if(e.length)return e;let s=D(process.cwd(),r);return z(s)?s:e},"");if(z(t))return t}async function rn(t,e="",r={}){let s=Xe(r,await Yr(t,e));!s.build?.mode&&(s.build?.watch||t.command==="serve")&&(s.build={...s.build,mode:"development"});let n=be.parse(s);return t.command==="serve"&&(await Le(n.server.ports.server)||(P.error(de("errors.port-busy",{busy:n.server.ports.server})),process.exit(1)),await Le(n.server.ports.gateway)||(P.error(de("errors.port-busy",{busy:n.server.ports.gateway})),process.exit(1))),{...n,entries:Gr(n.entries)}}function sn(t,e){let r={};if(z(e.entries.manifest)){let s=Ze(at(e.entries.manifest).toString()),n=Ke(s,de("errors.invalid-manifest"));typeof n=="string"&&(P.error(n),process.exit(1)),r.ALLIANCE_APP_MANIFEST=n,r.ALLIANCE_APP_NAME=JSON.stringify(n.name)}return t==="build"&&(!z(e.entries.manifest)||!z(e.entries.app))&&(P.error(de("errors.no-entry",{app:je(process.cwd(),D(e.entries.app)),manifest:je(process.cwd(),D(e.entries.manifest))})),process.exit(1)),t==="serve"&&(r.ALLIANCE_ENVIRONMENT={logging:e.server.logging}),r}function nn({entries:t,server:e}){let r=[];z(t.app)&&z(t.manifest)&&r.push({packageName:"entry",appImportPath:t.app,manifestImportPath:t.manifest});for(let s of e.apps)r.push({packageName:s,appImportPath:`${s}/app`,manifestImportPath:`${s}/manifest`});return r.length||(P.error(de("errors.no-entry",{app:je(process.cwd(),D(t.app)),manifest:je(process.cwd(),D(t.manifest))})),process.exit(1)),r}export{Ze as a,N as b,J as c,tt as d,rt as e,ke as f,st as g,Qs as h,de as i,Xs as j,en as k,tn as l,rn as m,sn as n,nn as o};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createRequire as c__createRequire } from 'node:module';
|
|
2
|
+
const require = c__createRequire(import.meta.url);
|
|
3
|
+
import*as v from"tty";var{env:y={},argv:J=[],platform:cu=""}=typeof process>"u"?{}:process,fu="NO_COLOR"in y||J.includes("--no-color"),Bu="FORCE_COLOR"in y||J.includes("--color"),Au=cu==="win32",X=y.TERM==="dumb",pu=v&&v.isatty&&v.isatty(1)&&y.TERM&&!X,gu="CI"in y&&("GITHUB_ACTIONS"in y||"GITLAB_CI"in y||"CIRCLECI"in y),hu=!fu&&(Bu||Au&&!X||pu||gu);function Q(u,D,e,F,t=D.slice(0,Math.max(0,u))+F,r=D.slice(Math.max(0,u+e.length)),o=r.indexOf(e)){return t+(o<0?r:Q(o,r,e,F))}function du(u,D,e,F,t){return u<0?e+D+F:e+Q(u,D,F,t)+F}function mu(u,D,e=u,F=u.length+1){return t=>t||!(t===""||t===void 0)?du((""+t).indexOf(D,F),t,u,D,e):""}function E(u,D,e){return mu(`\x1B[${u}m`,`\x1B[${D}m`,e)}var Z={reset:E(0,0),bold:E(1,22,"\x1B[22m\x1B[1m"),dim:E(2,22,"\x1B[22m\x1B[2m"),italic:E(3,23),underline:E(4,24),inverse:E(7,27),hidden:E(8,28),strikethrough:E(9,29),black:E(30,39),red:E(31,39),green:E(32,39),yellow:E(33,39),blue:E(34,39),magenta:E(35,39),cyan:E(36,39),white:E(37,39),gray:E(90,39),bgBlack:E(40,49),bgRed:E(41,49),bgGreen:E(42,49),bgYellow:E(43,49),bgBlue:E(44,49),bgMagenta:E(45,49),bgCyan:E(46,49),bgWhite:E(47,49),blackBright:E(90,39),redBright:E(91,39),greenBright:E(92,39),yellowBright:E(93,39),blueBright:E(94,39),magentaBright:E(95,39),cyanBright:E(96,39),whiteBright:E(97,39),bgBlackBright:E(100,49),bgRedBright:E(101,49),bgGreenBright:E(102,49),bgYellowBright:E(103,49),bgBlueBright:E(104,49),bgMagentaBright:E(105,49),bgCyanBright:E(106,49),bgWhiteBright:E(107,49)};function _u(u=hu){return u?Z:Object.fromEntries(Object.keys(Z).map(D=>[D,String]))}var l=_u();function x(u,D="reset"){return l[u]||l[D]}function yu(u,D){return x(u)(D)}var bu=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");function _(u){return u.replace(new RegExp(bu,"g"),"")}var K={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},Lu={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function N(u,D={}){let e={...D,style:{...Lu,...D.style}},F=u.split(`
|
|
4
|
+
`),t=[],r=x(e.style.borderColor),o={...typeof e.style.borderStyle=="string"?K[e.style.borderStyle]||K.solid:e.style.borderStyle};if(r)for(let i in o)o[i]=r(o[i]);let n=e.style.padding%2===0?e.style.padding:e.style.padding+1,s=F.length+n,a=Math.max(...F.map(i=>_(i).length),e.title?_(e.title).length:0)+n,C=a+n,A=e.style.marginLeft>0?" ".repeat(e.style.marginLeft):"";if(e.style.marginTop>0&&t.push("".repeat(e.style.marginTop)),e.title){let i=r?r(e.title):e.title,c=o.h.repeat(Math.floor((a-_(e.title).length)/2)),p=o.h.repeat(a-_(e.title).length-_(c).length+n);t.push(`${A}${o.tl}${c}${i}${p}${o.tr}`)}else t.push(`${A}${o.tl}${o.h.repeat(C)}${o.tr}`);let g=e.style.valign==="center"?Math.floor((s-F.length)/2):e.style.valign==="top"?s-F.length-n:s-F.length;for(let i=0;i<s;i++)if(i<g||i>=g+F.length)t.push(`${A}${o.v}${" ".repeat(C)}${o.v}`);else{let c=F[i-g],p=" ".repeat(n),m=" ".repeat(a-_(c).length);t.push(`${A}${o.v}${p}${c}${m}${o.v}`)}return t.push(`${A}${o.bl}${o.h.repeat(C)}${o.br}`),e.style.marginBottom>0&&t.push("".repeat(e.style.marginBottom)),t.join(`
|
|
5
|
+
`)}var B={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},U={silent:{level:-1},fatal:{level:B.fatal},error:{level:B.error},warn:{level:B.warn},log:{level:B.log},info:{level:B.info},success:{level:B.success},fail:{level:B.fail},ready:{level:B.info},start:{level:B.info},box:{level:B.info},debug:{level:B.debug},trace:{level:B.trace},verbose:{level:B.verbose}};function $(u){if(u===null||typeof u!="object")return!1;let D=Object.getPrototypeOf(u);return D!==null&&D!==Object.prototype&&Object.getPrototypeOf(D)!==null||Symbol.iterator in u?!1:Symbol.toStringTag in u?Object.prototype.toString.call(u)==="[object Module]":!0}function k(u,D,e=".",F){if(!$(D))return k(u,{},e,F);let t=Object.assign({},D);for(let r in u){if(r==="__proto__"||r==="constructor")continue;let o=u[r];o!=null&&(F&&F(t,r,o,e)||(Array.isArray(o)&&Array.isArray(t[r])?t[r]=[...o,...t[r]]:$(o)&&$(t[r])?t[r]=k(o,t[r],(e?`${e}.`:"")+r.toString(),F):t[r]=o))}return t}function wu(u){return(...D)=>D.reduce((e,F)=>k(e,F,"",u),{})}var Tu=wu();function Iu(u){return Object.prototype.toString.call(u)==="[object Object]"}function Su(u){return!(!Iu(u)||!u.message&&!u.args||u.stack)}var P=!1,uu=[],f=class u{options;_lastLog;_mockFn;constructor(D={}){let e=D.types||U;this.options=Tu({...D,defaults:{...D.defaults},level:M(D.level,e),reporters:[...D.reporters||[]]},{types:U,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let F in e){let t={type:F,...this.options.defaults,...e[F]};this[F]=this._wrapLogFn(t),this[F].raw=this._wrapLogFn(t,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(D){this.options.level=M(D,this.options.types,this.options.level)}prompt(D,e){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(D,e)}create(D){let e=new u({...this.options,...D});return this._mockFn&&e.mockTypes(this._mockFn),e}withDefaults(D){return this.create({...this.options,defaults:{...this.options.defaults,...D}})}withTag(D){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+D:D})}addReporter(D){return this.options.reporters.push(D),this}removeReporter(D){if(D){let e=this.options.reporters.indexOf(D);if(e!==-1)return this.options.reporters.splice(e,1)}else this.options.reporters.splice(0);return this}setReporters(D){return this.options.reporters=Array.isArray(D)?D:[D],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let D in this.options.types)console["__"+D]||(console["__"+D]=console[D]),console[D]=this[D].raw}restoreConsole(){for(let D in this.options.types)console["__"+D]&&(console[D]=console["__"+D],delete console["__"+D])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(D,e){D&&(D.__write||(D.__write=D.write),D.write=F=>{this[e].raw(String(F).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(D){D&&D.__write&&(D.write=D.__write,delete D.__write)}pauseLogs(){P=!0}resumeLogs(){P=!1;let D=uu.splice(0);for(let e of D)e[0]._logFn(e[1],e[2])}mockTypes(D){let e=D||this.options.mockFn;if(this._mockFn=e,typeof e=="function")for(let F in this.options.types)this[F]=e(F,this.options.types[F])||this[F],this[F].raw=this[F]}_wrapLogFn(D,e){return(...F)=>{if(P){uu.push([this,D,F,e]);return}return this._logFn(D,F,e)}}_logFn(D,e,F){if((D.level||0)>this.level)return!1;let t={date:new Date,args:[],...D,level:M(D.level,this.options.types)};!F&&e.length===1&&Su(e[0])?Object.assign(t,e[0]):t.args=[...e],t.message&&(t.args.unshift(t.message),delete t.message),t.additional&&(Array.isArray(t.additional)||(t.additional=t.additional.split(`
|
|
6
|
+
`)),t.args.push(`
|
|
7
|
+
`+t.additional.join(`
|
|
8
|
+
`)),delete t.additional),t.type=typeof t.type=="string"?t.type.toLowerCase():"log",t.tag=typeof t.tag=="string"?t.tag:"";let r=(n=!1)=>{let s=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&s>0){let a=[...this._lastLog.object.args];s>1&&a.push(`(repeated ${s} times)`),this._log({...this._lastLog.object,args:a}),this._lastLog.count=1}n&&(this._lastLog.object=t,this._log(t))};clearTimeout(this._lastLog.timeout);let o=this._lastLog.time&&t.date?t.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=t.date,o<this.options.throttle)try{let n=JSON.stringify([t.type,t.tag,t.args]),s=this._lastLog.serialized===n;if(this._lastLog.serialized=n,s&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(r,this.options.throttle);return}}catch{}r(!0)}_log(D){for(let e of this.options.reporters)e.log(D,{options:this.options})}};function M(u,D={},e=3){return u===void 0?e:typeof u=="number"?u:D[u]&&D[u].level!==void 0?D[u].level:e}f.prototype.add=f.prototype.addReporter;f.prototype.remove=f.prototype.removeReporter;f.prototype.clear=f.prototype.removeReporter;f.prototype.withScope=f.prototype.withTag;f.prototype.mock=f.prototype.mockTypes;f.prototype.pause=f.prototype.pauseLogs;f.prototype.resume=f.prototype.resumeLogs;function Du(u={}){return new f(u)}import{formatWithOptions as eu}from"util";import{sep as vu}from"path";function W(u,D){let e=process.cwd()+vu;return u.split(`
|
|
9
|
+
`).splice(D.split(`
|
|
10
|
+
`).length).map(t=>t.trim().replace("file://","").replace(e,""))}function Ru(u,D){return(D.__write||D.write).call(D,u)}var j=u=>u?`[${u}]`:"",I=class{formatStack(D,e,F){let t=" ".repeat((F?.errorLevel||0)+1);return t+W(D,e).join(`
|
|
11
|
+
${t}`)}formatError(D,e){let F=D.message??eu(e,D),t=D.stack?this.formatStack(D.stack,F,e):"",r=e?.errorLevel||0,o=r>0?`${" ".repeat(r)}[cause]: `:"",n=D.cause?`
|
|
12
|
+
|
|
13
|
+
`+this.formatError(D.cause,{...e,errorLevel:r+1}):"";return o+F+`
|
|
14
|
+
`+t+n}formatArgs(D,e){let F=D.map(t=>t&&typeof t.stack=="string"?this.formatError(t,e):t);return eu(e,...F)}formatDate(D,e){return e.date?D.toLocaleTimeString():""}filterAndJoin(D){return D.filter(Boolean).join(" ")}formatLogObj(D,e){let F=this.formatArgs(D.args,e);return D.type==="box"?`
|
|
15
|
+
`+[j(D.tag),D.title&&D.title,...F.split(`
|
|
16
|
+
`)].filter(Boolean).map(t=>" > "+t).join(`
|
|
17
|
+
`)+`
|
|
18
|
+
`:this.filterAndJoin([j(D.type),j(D.tag),F])}log(D,e){let F=this.formatLogObj(D,{columns:e.options.stdout.columns||0,...e.options.formatOptions});return Ru(F+`
|
|
19
|
+
`,D.level<2?e.options.stderr||process.stderr:e.options.stdout||process.stdout)}};import tu from"process";import"util";import"path";import"tty";var O=Object.create(null),S=u=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(u?O:globalThis),b=new Proxy(O,{get(u,D){return S()[D]??O[D]},has(u,D){let e=S();return D in e||D in O},set(u,D,e){let F=S(!0);return F[D]=e,!0},deleteProperty(u,D){if(!D)return!1;let e=S(!0);return delete e[D],!0},ownKeys(){let u=S(!0);return Object.keys(u)}}),Ou=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",xu=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function Nu(){if(globalThis.process?.env)for(let u of xu){let D=u[1]||u[0];if(globalThis.process?.env[D])return{name:u[0].toLowerCase(),...u[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}var ou=Nu();ou.name;function w(u){return u?u!=="false":!1}var $u=globalThis.process?.platform||"",Y=w(b.CI)||ou.ci!==!1,su=w(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),Pu=w(b.DEBUG),V=Ou==="test"||w(b.TEST);w(b.MINIMAL);var Mu=/^win/i.test($u);!w(b.NO_COLOR)&&(w(b.FORCE_COLOR)||(su||Mu)&&b.TERM);var Uu=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(Uu?.split(".")[0]);var ku=globalThis.process||Object.create(null),Fu={versions:{}};new Proxy(ku,{get(u,D){if(D==="env")return b;if(D in u)return u[D];if(D in Fu)return Fu[D]}});var ju=globalThis.process?.release?.name==="node",Wu=!!globalThis.Bun||!!globalThis.process?.versions?.bun,Gu=!!globalThis.Deno,Yu=!!globalThis.fastly,Vu=!!globalThis.Netlify,Hu=!!globalThis.EdgeRuntime,zu=globalThis.navigator?.userAgent==="Cloudflare-Workers",qu=[[Vu,"netlify"],[Hu,"edge-light"],[zu,"workerd"],[Yu,"fastly"],[Gu,"deno"],[Wu,"bun"],[ju,"node"]];function Zu(){let u=qu.find(D=>D[0]);if(u)return{name:u[1]}}var Ku=Zu();Ku?.name;function Ju({onlyFirst:u=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,u?void 0:"g")}var Xu=Ju();function Qu(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(Xu,"")}function uD(u){return u===161||u===164||u===167||u===168||u===170||u===173||u===174||u>=176&&u<=180||u>=182&&u<=186||u>=188&&u<=191||u===198||u===208||u===215||u===216||u>=222&&u<=225||u===230||u>=232&&u<=234||u===236||u===237||u===240||u===242||u===243||u>=247&&u<=250||u===252||u===254||u===257||u===273||u===275||u===283||u===294||u===295||u===299||u>=305&&u<=307||u===312||u>=319&&u<=322||u===324||u>=328&&u<=331||u===333||u===338||u===339||u===358||u===359||u===363||u===462||u===464||u===466||u===468||u===470||u===472||u===474||u===476||u===593||u===609||u===708||u===711||u>=713&&u<=715||u===717||u===720||u>=728&&u<=731||u===733||u===735||u>=768&&u<=879||u>=913&&u<=929||u>=931&&u<=937||u>=945&&u<=961||u>=963&&u<=969||u===1025||u>=1040&&u<=1103||u===1105||u===8208||u>=8211&&u<=8214||u===8216||u===8217||u===8220||u===8221||u>=8224&&u<=8226||u>=8228&&u<=8231||u===8240||u===8242||u===8243||u===8245||u===8251||u===8254||u===8308||u===8319||u>=8321&&u<=8324||u===8364||u===8451||u===8453||u===8457||u===8467||u===8470||u===8481||u===8482||u===8486||u===8491||u===8531||u===8532||u>=8539&&u<=8542||u>=8544&&u<=8555||u>=8560&&u<=8569||u===8585||u>=8592&&u<=8601||u===8632||u===8633||u===8658||u===8660||u===8679||u===8704||u===8706||u===8707||u===8711||u===8712||u===8715||u===8719||u===8721||u===8725||u===8730||u>=8733&&u<=8736||u===8739||u===8741||u>=8743&&u<=8748||u===8750||u>=8756&&u<=8759||u===8764||u===8765||u===8776||u===8780||u===8786||u===8800||u===8801||u>=8804&&u<=8807||u===8810||u===8811||u===8814||u===8815||u===8834||u===8835||u===8838||u===8839||u===8853||u===8857||u===8869||u===8895||u===8978||u>=9312&&u<=9449||u>=9451&&u<=9547||u>=9552&&u<=9587||u>=9600&&u<=9615||u>=9618&&u<=9621||u===9632||u===9633||u>=9635&&u<=9641||u===9650||u===9651||u===9654||u===9655||u===9660||u===9661||u===9664||u===9665||u>=9670&&u<=9672||u===9675||u>=9678&&u<=9681||u>=9698&&u<=9701||u===9711||u===9733||u===9734||u===9737||u===9742||u===9743||u===9756||u===9758||u===9792||u===9794||u===9824||u===9825||u>=9827&&u<=9829||u>=9831&&u<=9834||u===9836||u===9837||u===9839||u===9886||u===9887||u===9919||u>=9926&&u<=9933||u>=9935&&u<=9939||u>=9941&&u<=9953||u===9955||u===9960||u===9961||u>=9963&&u<=9969||u===9972||u>=9974&&u<=9977||u===9979||u===9980||u===9982||u===9983||u===10045||u>=10102&&u<=10111||u>=11094&&u<=11097||u>=12872&&u<=12879||u>=57344&&u<=63743||u>=65024&&u<=65039||u===65533||u>=127232&&u<=127242||u>=127248&&u<=127277||u>=127280&&u<=127337||u>=127344&&u<=127373||u===127375||u===127376||u>=127387&&u<=127404||u>=917760&&u<=917999||u>=983040&&u<=1048573||u>=1048576&&u<=1114109}function DD(u){return u===12288||u>=65281&&u<=65376||u>=65504&&u<=65510}function eD(u){return u>=4352&&u<=4447||u===8986||u===8987||u===9001||u===9002||u>=9193&&u<=9196||u===9200||u===9203||u===9725||u===9726||u===9748||u===9749||u>=9776&&u<=9783||u>=9800&&u<=9811||u===9855||u>=9866&&u<=9871||u===9875||u===9889||u===9898||u===9899||u===9917||u===9918||u===9924||u===9925||u===9934||u===9940||u===9962||u===9970||u===9971||u===9973||u===9978||u===9981||u===9989||u===9994||u===9995||u===10024||u===10060||u===10062||u>=10067&&u<=10069||u===10071||u>=10133&&u<=10135||u===10160||u===10175||u===11035||u===11036||u===11088||u===11093||u>=11904&&u<=11929||u>=11931&&u<=12019||u>=12032&&u<=12245||u>=12272&&u<=12287||u>=12289&&u<=12350||u>=12353&&u<=12438||u>=12441&&u<=12543||u>=12549&&u<=12591||u>=12593&&u<=12686||u>=12688&&u<=12773||u>=12783&&u<=12830||u>=12832&&u<=12871||u>=12880&&u<=42124||u>=42128&&u<=42182||u>=43360&&u<=43388||u>=44032&&u<=55203||u>=63744&&u<=64255||u>=65040&&u<=65049||u>=65072&&u<=65106||u>=65108&&u<=65126||u>=65128&&u<=65131||u>=94176&&u<=94180||u===94192||u===94193||u>=94208&&u<=100343||u>=100352&&u<=101589||u>=101631&&u<=101640||u>=110576&&u<=110579||u>=110581&&u<=110587||u===110589||u===110590||u>=110592&&u<=110882||u===110898||u>=110928&&u<=110930||u===110933||u>=110948&&u<=110951||u>=110960&&u<=111355||u>=119552&&u<=119638||u>=119648&&u<=119670||u===126980||u===127183||u===127374||u>=127377&&u<=127386||u>=127488&&u<=127490||u>=127504&&u<=127547||u>=127552&&u<=127560||u===127568||u===127569||u>=127584&&u<=127589||u>=127744&&u<=127776||u>=127789&&u<=127797||u>=127799&&u<=127868||u>=127870&&u<=127891||u>=127904&&u<=127946||u>=127951&&u<=127955||u>=127968&&u<=127984||u===127988||u>=127992&&u<=128062||u===128064||u>=128066&&u<=128252||u>=128255&&u<=128317||u>=128331&&u<=128334||u>=128336&&u<=128359||u===128378||u===128405||u===128406||u===128420||u>=128507&&u<=128591||u>=128640&&u<=128709||u===128716||u>=128720&&u<=128722||u>=128725&&u<=128727||u>=128732&&u<=128735||u===128747||u===128748||u>=128756&&u<=128764||u>=128992&&u<=129003||u===129008||u>=129292&&u<=129338||u>=129340&&u<=129349||u>=129351&&u<=129535||u>=129648&&u<=129660||u>=129664&&u<=129673||u>=129679&&u<=129734||u>=129742&&u<=129756||u>=129759&&u<=129769||u>=129776&&u<=129784||u>=131072&&u<=196605||u>=196608&&u<=262141}function tD(u){if(!Number.isSafeInteger(u))throw new TypeError(`Expected a code point, got \`${typeof u}\`.`)}function FD(u,{ambiguousAsWide:D=!1}={}){return tD(u),DD(u)||eD(u)||D&&uD(u)?2:1}var nD=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,rD=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:u=>u.split("")},oD=/^\p{Default_Ignorable_Code_Point}$/u;function sD(u,D={}){if(typeof u!="string"||u.length===0)return 0;let{ambiguousIsNarrow:e=!0,countAnsiEscapeCodes:F=!1}=D;if(F||(u=Qu(u)),u.length===0)return 0;let t=0,r={ambiguousAsWide:!e};for(let{segment:o}of rD.segment(u)){let n=o.codePointAt(0);if(!(n<=31||n>=127&&n<=159)&&!(n>=8203&&n<=8207||n===65279)&&!(n>=768&&n<=879||n>=6832&&n<=6911||n>=7616&&n<=7679||n>=8400&&n<=8447||n>=65056&&n<=65071)&&!(n>=55296&&n<=57343)&&!(n>=65024&&n<=65039)&&!oD.test(o)){if(nD().test(o)){t+=2;continue}t+=FD(n,r)}}return t}function iD(){let{env:u}=tu,{TERM:D,TERM_PROGRAM:e}=u;return tu.platform!=="win32"?D!=="linux":!!u.WT_SESSION||!!u.TERMINUS_SUBLIME||u.ConEmuTask==="{cmd::Cmder}"||e==="Terminus-Sublime"||e==="vscode"||D==="xterm-256color"||D==="alacritty"||D==="rxvt-unicode"||D==="rxvt-unicode-256color"||u.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var aD={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},ED={0:"red",1:"yellow"},CD=iD(),d=(u,D)=>CD?u:D,nu={error:d("\u2716","\xD7"),fatal:d("\u2716","\xD7"),ready:d("\u2714","\u221A"),warn:d("\u26A0","\u203C"),info:d("\u2139","i"),success:d("\u2714","\u221A"),debug:d("\u2699","D"),trace:d("\u2192","\u2192"),fail:d("\u2716","\xD7"),start:d("\u25D0","o"),log:""};function ru(u){return!(typeof Intl=="object")||!Intl.Segmenter?_(u).length:sD(u)}var G=class extends I{formatStack(D,e,F){let t=" ".repeat((F?.errorLevel||0)+1);return`
|
|
20
|
+
${t}`+W(D,e).map(r=>" "+r.replace(/^at +/,o=>l.gray(o)).replace(/\((.+)\)/,(o,n)=>`(${l.cyan(n)})`)).join(`
|
|
21
|
+
${t}`)}formatType(D,e,F){let t=aD[D.type]||ED[D.level]||"gray";if(e)return cD(t)(l.black(` ${D.type.toUpperCase()} `));let r=typeof nu[D.type]=="string"?nu[D.type]:D.icon||D.type;return r?lD(t)(r):""}formatLogObj(D,e){let[F,...t]=this.formatArgs(D.args,e).split(`
|
|
22
|
+
`);if(D.type==="box")return N(R(F+(t.length>0?`
|
|
23
|
+
`+t.join(`
|
|
24
|
+
`):"")),{title:D.title?R(D.title):void 0,style:D.style});let r=this.formatDate(D.date,e),o=r&&l.gray(r),n=D.badge??D.level<2,s=this.formatType(D,n,e),a=D.tag?l.gray(D.tag):"",C,A=this.filterAndJoin([s,R(F)]),g=this.filterAndJoin(e.columns?[a,o]:[a]),i=(e.columns||0)-ru(A)-ru(g)-2;if(C=i>0&&(e.columns||0)>=80?A+" ".repeat(i)+g:(g?`${l.gray(`[${g}]`)} `:"")+A,C+=R(t.length>0?`
|
|
25
|
+
`+t.join(`
|
|
26
|
+
`):""),D.type==="trace"){let c=new Error("Trace: "+D.message);C+=this.formatStack(c.stack||"",c.message)}return n?`
|
|
27
|
+
`+C+`
|
|
28
|
+
`:C}};function R(u){return u.replace(/`([^`]+)`/gm,(D,e)=>l.cyan(e)).replace(/\s+_([^_]+)_\s+/gm,(D,e)=>` ${l.underline(e)} `)}function lD(u="white"){return l[u]||l.white}function cD(u="bgWhite"){return l[`bg${u[0].toUpperCase()}${u.slice(1)}`]||l.bgWhite}function fD(u={}){let D=BD();return process.env.CONSOLA_LEVEL&&(D=Number.parseInt(process.env.CONSOLA_LEVEL)??D),Du({level:D,defaults:{level:D},stdout:process.stdout,stderr:process.stderr,prompt:(...F)=>import("./prompt-KI4FQCI3.js").then(t=>t.prompt(...F)),reporters:u.reporters||[u.fancy??!(Y||V)?new G:new I],...u})}function BD(){return Pu?B.debug:V?B.warn:B.info}var T=fD();import"tty";function AD(u){return Array.isArray(u)?u:u===void 0?[]:[u]}function H(u,D=""){let e=[];for(let F of u)for(let[t,r]of F.entries())e[t]=Math.max(e[t]||0,r.length);return u.map(F=>F.map((t,r)=>D+t[r===0?"padStart":"padEnd"](e[r])).join(" ")).join(`
|
|
29
|
+
`)}function h(u){return typeof u=="function"?u():u}var L=class extends Error{constructor(D,e){super(D),this.code=e,this.name="CLIError"}},pD=/\d/,gD=["-","_","/","."];function hD(u=""){if(!pD.test(u))return u!==u.toLowerCase()}function iu(u,D){let e=D??gD,F=[];if(!u||typeof u!="string")return F;let t="",r,o;for(let n of u){let s=e.includes(n);if(s===!0){F.push(t),t="",r=void 0;continue}let a=hD(n);if(o===!1){if(r===!1&&a===!0){F.push(t),t=n,r=a;continue}if(r===!0&&a===!1&&t.length>1){let C=t.at(-1);F.push(t.slice(0,Math.max(0,t.length-1))),t=C+n,r=a;continue}}t+=n,r=a,o=s}return F.push(t),F}function dD(u){return u?u[0].toUpperCase()+u.slice(1):""}function mD(u){return u?u[0].toLowerCase()+u.slice(1):""}function _D(u,D){return u?(Array.isArray(u)?u:iu(u)).map(e=>dD(D?.normalize?e.toLowerCase():e)).join(""):""}function yD(u,D){return mD(_D(u||"",D))}function bD(u,D){return u?(Array.isArray(u)?u:iu(u)).map(e=>e.toLowerCase()).join(D??"-"):""}function z(u){return u==null?[]:Array.isArray(u)?u:[u]}function LD(u,D,e,F){let t,r=u[D],o=~F.string.indexOf(D)?e==null||e===!0?"":String(e):typeof e=="boolean"?e:~F.boolean.indexOf(D)?e==="false"?!1:e==="true"||(u._.push((t=+e,t*0===0?t:e)),!!e):(t=+e,t*0===0?t:e);u[D]=r==null?o:Array.isArray(r)?r.concat(o):[r,o]}function wD(u=[],D={}){let e,F,t,r,o,n={_:[]},s=0,a=0,C=0,A=u.length,g=D.alias!==void 0,i=D.unknown!==void 0,c=D.default!==void 0;if(D.alias=D.alias||{},D.string=z(D.string),D.boolean=z(D.boolean),g)for(e in D.alias)for(F=D.alias[e]=z(D.alias[e]),s=0;s<F.length;s++)(D.alias[F[s]]=F.concat(e)).splice(s,1);for(s=D.boolean.length;s-- >0;)for(F=D.alias[D.boolean[s]]||[],a=F.length;a-- >0;)D.boolean.push(F[a]);for(s=D.string.length;s-- >0;)for(F=D.alias[D.string[s]]||[],a=F.length;a-- >0;)D.string.push(F[a]);if(c){for(e in D.default)if(r=typeof D.default[e],F=D.alias[e]=D.alias[e]||[],D[r]!==void 0)for(D[r].push(e),s=0;s<F.length;s++)D[r].push(F[s])}let p=i?Object.keys(D.alias):[];for(s=0;s<A;s++){if(t=u[s],t==="--"){n._=n._.concat(u.slice(++s));break}for(a=0;a<t.length&&t.charCodeAt(a)===45;a++);if(a===0)n._.push(t);else if(t.substring(a,a+3)==="no-"){if(r=t.slice(Math.max(0,a+3)),i&&!~p.indexOf(r))return D.unknown(t);n[r]=!1}else{for(C=a+1;C<t.length&&t.charCodeAt(C)!==61;C++);for(r=t.substring(a,C),o=t.slice(Math.max(0,++C))||s+1===A||(""+u[s+1]).charCodeAt(0)===45||u[++s],F=a===2?[r]:r,C=0;C<F.length;C++){if(r=F[C],i&&!~p.indexOf(r))return D.unknown("-".repeat(a)+r);LD(n,r,C+1<F.length||o,D)}}}if(c)for(e in D.default)n[e]===void 0&&(n[e]=D.default[e]);if(g)for(e in n)for(F=D.alias[e]||[];F.length>0;)n[F.shift()]=n[e];return n}function TD(u,D){let e={boolean:[],string:[],mixed:[],alias:{},default:{}},F=au(D);for(let n of F)n.type!=="positional"&&(n.type==="string"?e.string.push(n.name):n.type==="boolean"&&e.boolean.push(n.name),n.default!==void 0&&(e.default[n.name]=n.default),n.alias&&(e.alias[n.name]=n.alias));let t=wD(u,e),[...r]=t._,o=new Proxy(t,{get(n,s){return n[s]??n[yD(s)]??n[bD(s)]}});for(let[,n]of F.entries())if(n.type==="positional"){let s=r.shift();if(s!==void 0)o[n.name]=s;else{if(n.default===void 0&&n.required!==!1)throw new L(`Missing required positional argument: ${n.name.toUpperCase()}`,"EARG");o[n.name]=n.default}}else if(n.required&&o[n.name]===void 0)throw new L(`Missing required argument: --${n.name}`,"EARG");return o}function au(u){let D=[];for(let[e,F]of Object.entries(u||{}))D.push({...F,name:e,alias:AD(F.alias)});return D}async function Eu(u,D){let e=await h(u.args||{}),F=TD(D.rawArgs,e),t={rawArgs:D.rawArgs,args:F,data:D.data,cmd:u};typeof u.setup=="function"&&await u.setup(t);let r;try{let o=await h(u.subCommands);if(o&&Object.keys(o).length>0){let n=D.rawArgs.findIndex(a=>!a.startsWith("-")),s=D.rawArgs[n];if(s){if(!o[s])throw new L(`Unknown command \`${s}\``,"E_UNKNOWN_COMMAND");let a=await h(o[s]);a&&await Eu(a,{rawArgs:D.rawArgs.slice(n+1)})}else if(!u.run)throw new L("No command specified.","E_NO_COMMAND")}typeof u.run=="function"&&(r=await u.run(t))}finally{typeof u.cleanup=="function"&&await u.cleanup(t)}return{result:r}}async function q(u,D,e){let F=await h(u.subCommands);if(F&&Object.keys(F).length>0){let t=D.findIndex(n=>!n.startsWith("-")),r=D[t],o=await h(F[r]);if(o)return q(o,D.slice(t+1),u)}return[u,e]}async function ID(u,D){try{T.log(await SD(u,D)+`
|
|
30
|
+
`)}catch(e){T.error(e)}}async function SD(u,D){let e=await h(u.meta||{}),F=au(await h(u.args||{})),t=await h(D?.meta||{}),r=`${t.name?`${t.name} `:""}`+(e.name||process.argv[1]),o=[],n=[],s=[],a=[];for(let i of F)if(i.type==="positional"){let c=i.name.toUpperCase(),p=i.required!==!1&&i.default===void 0,m=i.default?`="${i.default}"`:"";n.push(["`"+c+m+"`",i.description||"",i.valueHint?`<${i.valueHint}>`:""]),a.push(p?`<${c}>`:`[${c}]`)}else{let c=i.required===!0&&i.default===void 0,p=(i.type==="boolean"&&i.default===!0?[...(i.alias||[]).map(m=>`--no-${m}`),`--no-${i.name}`].join(", "):[...(i.alias||[]).map(m=>`-${m}`),`--${i.name}`].join(", "))+(i.type==="string"&&(i.valueHint||i.default)?`=${i.valueHint?`<${i.valueHint}>`:`"${i.default||""}"`}`:"");o.push(["`"+p+(c?" (required)":"")+"`",i.description||""]),c&&a.push(p)}if(u.subCommands){let i=[],c=await h(u.subCommands);for(let[p,m]of Object.entries(c)){let Cu=await h(m),lu=await h(Cu?.meta);s.push([`\`${p}\``,lu?.description||""]),i.push(p)}a.push(i.join("|"))}let C=[],A=e.version||t.version;C.push(l.gray(`${e.description} (${r+(A?` v${A}`:"")})`),"");let g=o.length>0||n.length>0;return C.push(`${l.underline(l.bold("USAGE"))} \`${r}${g?" [OPTIONS]":""} ${a.join(" ")}\``,""),n.length>0&&(C.push(l.underline(l.bold("ARGUMENTS")),""),C.push(H(n," ")),C.push("")),o.length>0&&(C.push(l.underline(l.bold("OPTIONS")),""),C.push(H(o," ")),C.push("")),s.length>0&&(C.push(l.underline(l.bold("COMMANDS")),""),C.push(H(s," ")),C.push("",`Use \`${r} <command> --help\` for more information about a command.`)),C.filter(i=>typeof i=="string").join(`
|
|
31
|
+
`)}async function De(u,D={}){let e=D.rawArgs||process.argv.slice(2),F=D.showUsage||ID;try{if(e.includes("--help")||e.includes("-h"))await F(...await q(u,e)),process.exit(0);else if(e.length===1&&e[0]==="--version"){let t=typeof u.meta=="function"?await u.meta():await u.meta;if(!t?.version)throw new L("No version specified","E_NO_VERSION");T.log(t.version)}else await Eu(u,{rawArgs:e})}catch(t){let r=t instanceof L;r||T.error(t,`
|
|
32
|
+
`),r&&await F(...await q(u,e)),T.error(t.message),process.exit(1)}}export{x as a,yu as b,T as c,De as d};
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as c__createRequire } from 'node:module';
|
|
3
3
|
const require = c__createRequire(import.meta.url);
|
|
4
|
-
import{b as i,c as n,d as a}from"./chunk-
|
|
4
|
+
import{b as i,c as n,d as a}from"./chunk-SQJLD7IF.js";import"./chunk-MCRDX3J3.js";var l="@telia-ace/alliance-cli",o="4.0.0-next.6",s="CLI used when developing ACE Alliance apps.";try{await a({meta:{name:l,version:o,description:s},subCommands:{build:()=>import("./build-B7JNCB5Q.js").then(e=>e.default),serve:()=>import("./serve-4CGYCEYF.js").then(e=>e.default),jwt:()=>import("./jwt-ARROXAEA.js").then(e=>e.default),"public-key":()=>import("./public-key-GRPF4KHS.js").then(e=>e.default),upgrade:()=>import("./upgrade-P3X5DB22.js").then(e=>e.default)}})}catch(e){n.error(i("bold",i("red","Error:")),i("bold",e?.message||"something went wrong"))}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as c__createRequire } from 'node:module';
|
|
2
2
|
const require = c__createRequire(import.meta.url);
|
|
3
|
-
import{i as s,k as t,l as n}from"./chunk-
|
|
3
|
+
import{i as s,k as t,l as n}from"./chunk-MJYEZ65F.js";import"./chunk-SQJLD7IF.js";import"./chunk-MCRDX3J3.js";import{createBearerToken as u,getPrivateKey as m,slugify as o,zSharedConfig as l}from"@telia-ace/alliance-internal-node-utilities";var f={meta:{name:"jwt",description:s("command.jwt")},args:{app:{type:"string",description:s("arg.jwt.app"),required:!1,alias:"a",default:"the-app"},workspace:{type:"string",description:s("arg.jwt.workspace"),required:!1,alias:"w",default:"The Workspace"},organization:{type:"string",description:s("arg.jwt.organization"),required:!1,alias:"o",default:"The Organization"},expiration:{type:"string",description:s("arg.jwt.expiration"),required:!1,alias:"e",default:"1d"},"user.firstName":{type:"string",description:s("arg.jwt.user.firstName"),required:!1,default:"John"},"user.lastName":{type:"string",description:s("arg.jwt.user.lastName"),required:!1,default:"Doe"},"user.email":{type:"string",description:s("arg.jwt.user.email"),required:!1,default:"john.doe@acme.org"},"user.permission":{type:"string",description:s("arg.jwt.user.permission"),required:!1,alias:"p"},"user.sub":{type:"string",description:s("arg.jwt.user.sub"),required:!1,alias:"s",default:"2ccaa1b2-5e34-4dd7-bb47-28435e973969"},debug:t},run({args:e}){let r=[];if(Array.isArray(e["user.permission"]))for(let a of e["user.permission"])typeof a=="string"&&r.push(a);else typeof e["user.permission"]=="string"&&r.push(e["user.permission"]);let i={user:{firstName:e["user.firstName"],lastName:e["user.lastName"],email:e["user.email"],permissions:r,sub:e["user.sub"]},app:e.app,workspace:{name:e.workspace,slug:o(e.workspace)},organization:{name:e.organization,slug:o(e.organization)},expiration:e.expiration},p=u({user:{id:i.user.sub,firstName:i.user.firstName,lastName:i.user.lastName,email:i.user.email,accessToken:"",permissions:i.user.permissions},audience:i.app,workspace:{name:i.workspace.name,slug:i.workspace.slug},organization:{name:i.organization.name,slug:i.organization.slug},privateKey:m(l.pick({JWT_PRIVATE_KEY:!0}).parse({}))});n({debug:e.debug,input:i,output:p})}};export{f as default};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createRequire as c__createRequire } from 'node:module';
|
|
2
|
+
const require = c__createRequire(import.meta.url);
|
|
3
|
+
import"./chunk-MCRDX3J3.js";import"util";import m,{stdin as iD,stdout as sD}from"process";import P from"readline";import{WriteStream as CD}from"tty";function nD(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _,L;function aD(){if(L)return _;L=1;let t="\x1B",u=`${t}[`,e="\x07",r={to(D,n){return n?`${u}${n+1};${D+1}H`:`${u}${D+1}G`},move(D,n){let s="";return D<0?s+=`${u}${-D}D`:D>0&&(s+=`${u}${D}C`),n<0?s+=`${u}${-n}A`:n>0&&(s+=`${u}${n}B`),s},up:(D=1)=>`${u}${D}A`,down:(D=1)=>`${u}${D}B`,forward:(D=1)=>`${u}${D}C`,backward:(D=1)=>`${u}${D}D`,nextLine:(D=1)=>`${u}E`.repeat(D),prevLine:(D=1)=>`${u}F`.repeat(D),left:`${u}G`,hide:`${u}?25l`,show:`${u}?25h`,save:`${t}7`,restore:`${t}8`},F={up:(D=1)=>`${u}S`.repeat(D),down:(D=1)=>`${u}T`.repeat(D)},C={screen:`${u}2J`,up:(D=1)=>`${u}1J`.repeat(D),down:(D=1)=>`${u}J`.repeat(D),line:`${u}2K`,lineEnd:`${u}K`,lineStart:`${u}1K`,lines(D){let n="";for(let s=0;s<D;s++)n+=this.line+(s<D-1?r.up():"");return D&&(n+=r.left),n}};return _={cursor:r,scroll:F,erase:C,beep:e},_}var b=aD(),$={exports:{}},N;function oD(){if(N)return $.exports;N=1;let t=process||{},u=t.argv||[],e=t.env||{},r=!(e.NO_COLOR||u.includes("--no-color"))&&(!!e.FORCE_COLOR||u.includes("--color")||t.platform==="win32"||(t.stdout||{}).isTTY&&e.TERM!=="dumb"||!!e.CI),F=(n,s,E=n)=>c=>{let a=""+c,h=a.indexOf(s,n.length);return~h?n+C(a,s,E,h)+s:n+a+s},C=(n,s,E,c)=>{let a="",h=0;do a+=n.substring(h,c)+E,h=c+s.length,c=n.indexOf(s,h);while(~c);return a+n.substring(h)},D=(n=r)=>{let s=n?F:()=>String;return{isColorSupported:n,reset:s("\x1B[0m","\x1B[0m"),bold:s("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:s("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:s("\x1B[3m","\x1B[23m"),underline:s("\x1B[4m","\x1B[24m"),inverse:s("\x1B[7m","\x1B[27m"),hidden:s("\x1B[8m","\x1B[28m"),strikethrough:s("\x1B[9m","\x1B[29m"),black:s("\x1B[30m","\x1B[39m"),red:s("\x1B[31m","\x1B[39m"),green:s("\x1B[32m","\x1B[39m"),yellow:s("\x1B[33m","\x1B[39m"),blue:s("\x1B[34m","\x1B[39m"),magenta:s("\x1B[35m","\x1B[39m"),cyan:s("\x1B[36m","\x1B[39m"),white:s("\x1B[37m","\x1B[39m"),gray:s("\x1B[90m","\x1B[39m"),bgBlack:s("\x1B[40m","\x1B[49m"),bgRed:s("\x1B[41m","\x1B[49m"),bgGreen:s("\x1B[42m","\x1B[49m"),bgYellow:s("\x1B[43m","\x1B[49m"),bgBlue:s("\x1B[44m","\x1B[49m"),bgMagenta:s("\x1B[45m","\x1B[49m"),bgCyan:s("\x1B[46m","\x1B[49m"),bgWhite:s("\x1B[47m","\x1B[49m"),blackBright:s("\x1B[90m","\x1B[39m"),redBright:s("\x1B[91m","\x1B[39m"),greenBright:s("\x1B[92m","\x1B[39m"),yellowBright:s("\x1B[93m","\x1B[39m"),blueBright:s("\x1B[94m","\x1B[39m"),magentaBright:s("\x1B[95m","\x1B[39m"),cyanBright:s("\x1B[96m","\x1B[39m"),whiteBright:s("\x1B[97m","\x1B[39m"),bgBlackBright:s("\x1B[100m","\x1B[49m"),bgRedBright:s("\x1B[101m","\x1B[49m"),bgGreenBright:s("\x1B[102m","\x1B[49m"),bgYellowBright:s("\x1B[103m","\x1B[49m"),bgBlueBright:s("\x1B[104m","\x1B[49m"),bgMagentaBright:s("\x1B[105m","\x1B[49m"),bgCyanBright:s("\x1B[106m","\x1B[49m"),bgWhiteBright:s("\x1B[107m","\x1B[49m")}};return $.exports=D(),$.exports.createColors=D,$.exports}var ED=oD(),i=nD(ED);function lD({onlyFirst:t=!1}={}){let u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(u,t?void 0:"g")}var cD=lD();function X(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(cD,"")}function DD(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var uD={exports:{}};(function(t){var u={};t.exports=u,u.eastAsianWidth=function(r){var F=r.charCodeAt(0),C=r.length==2?r.charCodeAt(1):0,D=F;return 55296<=F&&F<=56319&&56320<=C&&C<=57343&&(F&=1023,C&=1023,D=F<<10|C,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&D<=359||D==363||D==462||D==464||D==466||D==468||D==470||D==472||D==474||D==476||D==593||D==609||D==708||D==711||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"},u.characterLength=function(r){var F=this.eastAsianWidth(r);return F=="F"||F=="W"||F=="A"?2:1};function e(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(r){for(var F=e(r),C=0,D=0;D<F.length;D++)C=C+this.characterLength(F[D]);return C},u.slice=function(r,F,C){textLen=u.length(r),F=F||0,C=C||1,F<0&&(F=textLen+F),C<0&&(C=textLen+C);for(var D="",n=0,s=e(r),E=0;E<s.length;E++){var c=s[E],a=u.length(c);if(n>=F-(a==2?1:0))if(n+a<=C)D+=c;else break;n+=a}return D}})(uD);var hD=uD.exports,BD=DD(hD),mD=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},bD=DD(mD);function f(t,u={}){if(typeof t!="string"||t.length===0||(u={ambiguousIsNarrow:!0,...u},t=X(t),t.length===0))return 0;t=t.replace(bD()," ");let e=u.ambiguousIsNarrow?1:2,r=0;for(let F of t){let C=F.codePointAt(0);if(!(C<=31||C>=127&&C<=159||C>=768&&C<=879))switch(BD.eastAsianWidth(F)){case"F":case"W":r+=2;break;case"A":r+=e;break;default:r+=1}}return r}var k=10,q=(t=0)=>u=>`\x1B[${u+t}m`,z=(t=0)=>u=>`\x1B[${38+t};5;${u}m`,G=(t=0)=>(u,e,r)=>`\x1B[${38+t};2;${u};${e};${r}m`,l={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(l.modifier);var pD=Object.keys(l.color),gD=Object.keys(l.bgColor);[...pD,...gD];function AD(){let t=new Map;for(let[u,e]of Object.entries(l)){for(let[r,F]of Object.entries(e))l[r]={open:`\x1B[${F[0]}m`,close:`\x1B[${F[1]}m`},e[r]=l[r],t.set(F[0],F[1]);Object.defineProperty(l,u,{value:e,enumerable:!1})}return Object.defineProperty(l,"codes",{value:t,enumerable:!1}),l.color.close="\x1B[39m",l.bgColor.close="\x1B[49m",l.color.ansi=q(),l.color.ansi256=z(),l.color.ansi16m=G(),l.bgColor.ansi=q(k),l.bgColor.ansi256=z(k),l.bgColor.ansi16m=G(k),Object.defineProperties(l,{rgbToAnsi256:{value:(u,e,r)=>u===e&&e===r?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(e/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:u=>{let e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!e)return[0,0,0];let[r]=e;r.length===3&&(r=[...r].map(C=>C+C).join(""));let F=Number.parseInt(r,16);return[F>>16&255,F>>8&255,F&255]},enumerable:!1},hexToAnsi256:{value:u=>l.rgbToAnsi256(...l.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let e,r,F;if(u>=232)e=((u-232)*10+8)/255,r=e,F=e;else{u-=16;let n=u%36;e=Math.floor(u/36)/5,r=Math.floor(n/6)/5,F=n%6/5}let C=Math.max(e,r,F)*2;if(C===0)return 30;let D=30+(Math.round(F)<<2|Math.round(r)<<1|Math.round(e));return C===2&&(D+=60),D},enumerable:!1},rgbToAnsi:{value:(u,e,r)=>l.ansi256ToAnsi(l.rgbToAnsi256(u,e,r)),enumerable:!1},hexToAnsi:{value:u=>l.ansi256ToAnsi(l.hexToAnsi256(u)),enumerable:!1}}),l}var dD=AD(),y=new Set(["\x1B","\x9B"]),fD=39,I="\x07",eD="[",$D="]",tD="m",W=`${$D}8;;`,K=t=>`${y.values().next().value}${eD}${t}${tD}`,Y=t=>`${y.values().next().value}${W}${t}${I}`,vD=t=>t.split(" ").map(u=>f(u)),M=(t,u,e)=>{let r=[...u],F=!1,C=!1,D=f(X(t[t.length-1]));for(let[n,s]of r.entries()){let E=f(s);if(D+E<=e?t[t.length-1]+=s:(t.push(s),D=0),y.has(s)&&(F=!0,C=r.slice(n+1).join("").startsWith(W)),F){C?s===I&&(F=!1,C=!1):s===tD&&(F=!1);continue}D+=E,D===e&&n<r.length-1&&(t.push(""),D=0)}!D&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},xD=t=>{let u=t.split(" "),e=u.length;for(;e>0&&!(f(u[e-1])>0);)e--;return e===u.length?t:u.slice(0,e).join(" ")+u.slice(e).join("")},yD=(t,u,e={})=>{if(e.trim!==!1&&t.trim()==="")return"";let r="",F,C,D=vD(t),n=[""];for(let[E,c]of t.split(" ").entries()){e.trim!==!1&&(n[n.length-1]=n[n.length-1].trimStart());let a=f(n[n.length-1]);if(E!==0&&(a>=u&&(e.wordWrap===!1||e.trim===!1)&&(n.push(""),a=0),(a>0||e.trim===!1)&&(n[n.length-1]+=" ",a++)),e.hard&&D[E]>u){let h=u-a,g=1+Math.floor((D[E]-h-1)/u);Math.floor((D[E]-1)/u)<g&&n.push(""),M(n,c,u);continue}if(a+D[E]>u&&a>0&&D[E]>0){if(e.wordWrap===!1&&a<u){M(n,c,u);continue}n.push("")}if(a+D[E]>u&&e.wordWrap===!1){M(n,c,u);continue}n[n.length-1]+=c}e.trim!==!1&&(n=n.map(E=>xD(E)));let s=[...n.join(`
|
|
4
|
+
`)];for(let[E,c]of s.entries()){if(r+=c,y.has(c)){let{groups:h}=new RegExp(`(?:\\${eD}(?<code>\\d+)m|\\${W}(?<uri>.*)${I})`).exec(s.slice(E).join(""))||{groups:{}};if(h.code!==void 0){let g=Number.parseFloat(h.code);F=g===fD?void 0:g}else h.uri!==void 0&&(C=h.uri.length===0?void 0:h.uri)}let a=dD.codes.get(Number(F));s[E+1]===`
|
|
5
|
+
`?(C&&(r+=Y("")),F&&a&&(r+=K(a))):c===`
|
|
6
|
+
`&&(F&&a&&(r+=K(F)),C&&(r+=Y(C)))}return r};function J(t,u,e){return String(t).normalize().replace(/\r\n/g,`
|
|
7
|
+
`).split(`
|
|
8
|
+
`).map(r=>yD(r,u,e)).join(`
|
|
9
|
+
`)}var wD=["up","down","left","right","space","enter","cancel"],x={actions:new Set(wD),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function rD(t,u){if(typeof t=="string")return x.aliases.get(t)===u;for(let e of t)if(e!==void 0&&rD(e,u))return!0;return!1}function _D(t,u){if(t===u)return;let e=t.split(`
|
|
10
|
+
`),r=u.split(`
|
|
11
|
+
`),F=[];for(let C=0;C<Math.max(e.length,r.length);C++)e[C]!==r[C]&&F.push(C);return F}globalThis.process.platform.startsWith("win");var U=Symbol("clack:cancel");function v(t,u){let e=t;e.isTTY&&e.setRawMode(u)}var kD=Object.defineProperty,MD=(t,u,e)=>u in t?kD(t,u,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[u]=e,B=(t,u,e)=>(MD(t,typeof u!="symbol"?u+"":u,e),e),A=class{constructor(u,e=!0){B(this,"input"),B(this,"output"),B(this,"_abortSignal"),B(this,"rl"),B(this,"opts"),B(this,"_render"),B(this,"_track",!1),B(this,"_prevFrame",""),B(this,"_subscribers",new Map),B(this,"_cursor",0),B(this,"state","initial"),B(this,"error",""),B(this,"value");let{input:r=iD,output:F=sD,render:C,signal:D,...n}=u;this.opts=n,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=C.bind(this),this._track=e,this._abortSignal=D,this.input=r,this.output=F}unsubscribe(){this._subscribers.clear()}setSubscriber(u,e){let r=this._subscribers.get(u)??[];r.push(e),this._subscribers.set(u,r)}on(u,e){this.setSubscriber(u,{cb:e})}once(u,e){this.setSubscriber(u,{cb:e,once:!0})}emit(u,...e){let r=this._subscribers.get(u)??[],F=[];for(let C of r)C.cb(...e),C.once&&F.push(()=>r.splice(r.indexOf(C),1));for(let C of F)C()}prompt(){return new Promise((u,e)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),u(U);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let r=new CD(0);r._write=(F,C,D)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),D()},this.input.pipe(r),this.rl=P.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),P.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),v(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(b.cursor.show),this.output.off("resize",this.render),v(this.input,!1),u(this.value)}),this.once("cancel",()=>{this.output.write(b.cursor.show),this.output.off("resize",this.render),v(this.input,!1),u(U)})})}onKeypress(u,e){if(this.state==="error"&&(this.state="active"),e?.name&&(!this._track&&x.aliases.has(e.name)&&this.emit("cursor",x.aliases.get(e.name)),x.actions.has(e.name)&&this.emit("cursor",e.name)),u&&(u.toLowerCase()==="y"||u.toLowerCase()==="n")&&this.emit("confirm",u.toLowerCase()==="y"),u===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),u&&this.emit("key",u.toLowerCase()),e?.name==="return"){if(this.opts.validate){let r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}rD([u,e?.name,e?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
12
|
+
`),v(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let u=J(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
13
|
+
`).length-1;this.output.write(b.cursor.move(-999,u*-1))}render(){let u=J(this._render(this)??"",process.stdout.columns,{hard:!0});if(u!==this._prevFrame){if(this.state==="initial")this.output.write(b.cursor.hide);else{let e=_D(this._prevFrame,u);if(this.restoreCursor(),e&&e?.length===1){let r=e[0];this.output.write(b.cursor.move(0,r)),this.output.write(b.erase.lines(1));let F=u.split(`
|
|
14
|
+
`);this.output.write(F[r]),this._prevFrame=u,this.output.write(b.cursor.move(0,F.length-r-1));return}if(e&&e?.length>1){let r=e[0];this.output.write(b.cursor.move(0,r)),this.output.write(b.erase.down());let F=u.split(`
|
|
15
|
+
`).slice(r);this.output.write(F.join(`
|
|
16
|
+
`)),this._prevFrame=u;return}this.output.write(b.erase.down())}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u}}},S=class extends A{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(u){super(u,!1),this.value=!!u.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",e=>{this.output.write(b.cursor.move(0,-1)),this.value=e,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},SD=Object.defineProperty,TD=(t,u,e)=>u in t?SD(t,u,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[u]=e,Z=(t,u,e)=>(TD(t,typeof u!="symbol"?u+"":u,e),e),jD=class extends A{constructor(t){super(t,!1),Z(this,"options"),Z(this,"cursor",0),this.options=t.options,this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:u})=>u===t.cursorAt),0),this.on("key",u=>{u==="a"&&this.toggleAll()}),this.on("cursor",u=>{switch(u){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let t=this.value.length===this.options.length;this.value=t?[]:this.options.map(u=>u.value)}toggleValue(){let t=this.value.includes(this._value);this.value=t?this.value.filter(u=>u!==this._value):[...this.value,this._value]}},OD=Object.defineProperty,RD=(t,u,e)=>u in t?OD(t,u,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[u]=e,H=(t,u,e)=>(RD(t,typeof u!="symbol"?u+"":u,e),e),T=class extends A{constructor(u){super(u,!1),H(this,"options"),H(this,"cursor",0),this.options=u.options,this.cursor=this.options.findIndex(({value:e})=>e===u.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},j=class extends A{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let u=this.value.slice(0,this.cursor),[e,...r]=this.value.slice(this.cursor);return`${u}${i.inverse(e)}${r.join("")}`}get cursor(){return this._cursor}constructor(u){super(u),this.on("finalize",()=>{this.value||(this.value=u.defaultValue)})}};function VD(){return m.platform!=="win32"?m.env.TERM!=="linux":!!m.env.CI||!!m.env.WT_SESSION||!!m.env.TERMINUS_SUBLIME||m.env.ConEmuTask==="{cmd::Cmder}"||m.env.TERM_PROGRAM==="Terminus-Sublime"||m.env.TERM_PROGRAM==="vscode"||m.env.TERM==="xterm-256color"||m.env.TERM==="alacritty"||m.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ID=VD(),p=(t,u)=>ID?t:u,WD=p("\u276F",">"),PD=p("\u25A0","x"),LD=p("\u25B2","x"),ND=p("\u2714","\u221A"),o=p(""),d=p(""),O=p("\u25CF",">"),R=p("\u25CB"," "),qD=p("\u25FB","[\u2022]"),Q=p("\u25FC","[+]"),zD=p("\u25FB","[ ]"),w=t=>{switch(t){case"initial":case"active":return i.cyan(WD);case"cancel":return i.red(PD);case"error":return i.yellow(LD);case"submit":return i.green(ND)}},V=t=>{let{cursor:u,options:e,style:r}=t,F=t.maxItems??Number.POSITIVE_INFINITY,C=Math.max(process.stdout.rows-4,0),D=Math.min(C,Math.max(F,5)),n=0;u>=n+D-3?n=Math.max(Math.min(u-D+3,e.length-D),0):u<n+2&&(n=Math.max(u-2,0));let s=D<e.length&&n>0,E=D<e.length&&n+D<e.length;return e.slice(n,n+D).map((c,a,h)=>{let g=a===0&&s,FD=a===h.length-1&&E;return g||FD?i.dim("..."):r(c,a+n===u)})},GD=t=>new j({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let u=`${i.gray(o)}
|
|
17
|
+
${w(this.state)} ${t.message}
|
|
18
|
+
`,e=t.placeholder?i.inverse(t.placeholder[0])+i.dim(t.placeholder.slice(1)):i.inverse(i.hidden("_")),r=this.value?this.valueWithCursor:e;switch(this.state){case"error":return`${u.trim()}
|
|
19
|
+
${i.yellow(o)} ${r}
|
|
20
|
+
${i.yellow(d)} ${i.yellow(this.error)}
|
|
21
|
+
`;case"submit":return`${u}${i.gray(o)} ${i.dim(this.value||t.placeholder)}`;case"cancel":return`${u}${i.gray(o)} ${i.strikethrough(i.dim(this.value??""))}${this.value?.trim()?`
|
|
22
|
+
${i.gray(o)}`:""}`;default:return`${u}${i.cyan(o)} ${r}
|
|
23
|
+
${i.cyan(d)}
|
|
24
|
+
`}}}).prompt(),KD=t=>{let u=t.active??"Yes",e=t.inactive??"No";return new S({active:u,inactive:e,initialValue:t.initialValue??!0,render(){let r=`${i.gray(o)}
|
|
25
|
+
${w(this.state)} ${t.message}
|
|
26
|
+
`,F=this.value?u:e;switch(this.state){case"submit":return`${r}${i.gray(o)} ${i.dim(F)}`;case"cancel":return`${r}${i.gray(o)} ${i.strikethrough(i.dim(F))}
|
|
27
|
+
${i.gray(o)}`;default:return`${r}${i.cyan(o)} ${this.value?`${i.green(O)} ${u}`:`${i.dim(R)} ${i.dim(u)}`} ${i.dim("/")} ${this.value?`${i.dim(R)} ${i.dim(e)}`:`${i.green(O)} ${e}`}
|
|
28
|
+
${i.cyan(d)}
|
|
29
|
+
`}}}).prompt()},YD=t=>{let u=(e,r)=>{let F=e.label??String(e.value);switch(r){case"selected":return`${i.dim(F)}`;case"active":return`${i.green(O)} ${F} ${e.hint?i.dim(`(${e.hint})`):""}`;case"cancelled":return`${i.strikethrough(i.dim(F))}`;default:return`${i.dim(R)} ${i.dim(F)}`}};return new T({options:t.options,initialValue:t.initialValue,render(){let e=`${i.gray(o)}
|
|
30
|
+
${w(this.state)} ${t.message}
|
|
31
|
+
`;switch(this.state){case"submit":return`${e}${i.gray(o)} ${u(this.options[this.cursor],"selected")}`;case"cancel":return`${e}${i.gray(o)} ${u(this.options[this.cursor],"cancelled")}
|
|
32
|
+
${i.gray(o)}`;default:return`${e}${i.cyan(o)} ${V({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(r,F)=>u(r,F?"active":"inactive")}).join(`
|
|
33
|
+
${i.cyan(o)} `)}
|
|
34
|
+
${i.cyan(d)}
|
|
35
|
+
`}}}).prompt()},JD=t=>{let u=(e,r)=>{let F=e.label??String(e.value);return r==="active"?`${i.cyan(qD)} ${F} ${e.hint?i.dim(`(${e.hint})`):""}`:r==="selected"?`${i.green(Q)} ${i.dim(F)}`:r==="cancelled"?`${i.strikethrough(i.dim(F))}`:r==="active-selected"?`${i.green(Q)} ${F} ${e.hint?i.dim(`(${e.hint})`):""}`:r==="submitted"?`${i.dim(F)}`:`${i.dim(zD)} ${i.dim(F)}`};return new jD({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(e){if(this.required&&e.length===0)return`Please select at least one option.
|
|
36
|
+
${i.reset(i.dim(`Press ${i.gray(i.bgWhite(i.inverse(" space ")))} to select, ${i.gray(i.bgWhite(i.inverse(" enter ")))} to submit`))}`},render(){let e=`${i.gray(o)}
|
|
37
|
+
${w(this.state)} ${t.message}
|
|
38
|
+
`,r=(F,C)=>{let D=this.value.includes(F.value);return C&&D?u(F,"active-selected"):D?u(F,"selected"):u(F,C?"active":"inactive")};switch(this.state){case"submit":return`${e}${i.gray(o)} ${this.options.filter(({value:F})=>this.value.includes(F)).map(F=>u(F,"submitted")).join(i.dim(", "))||i.dim("none")}`;case"cancel":{let F=this.options.filter(({value:C})=>this.value.includes(C)).map(C=>u(C,"cancelled")).join(i.dim(", "));return`${e}${i.gray(o)} ${F.trim()?`${F}
|
|
39
|
+
${i.gray(o)}`:""}`}case"error":{let F=this.error.split(`
|
|
40
|
+
`).map((C,D)=>D===0?`${i.yellow(d)} ${i.yellow(C)}`:` ${C}`).join(`
|
|
41
|
+
`);return`${e+i.yellow(o)} ${V({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:r}).join(`
|
|
42
|
+
${i.yellow(o)} `)}
|
|
43
|
+
${F}
|
|
44
|
+
`}default:return`${e}${i.cyan(o)} ${V({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:r}).join(`
|
|
45
|
+
${i.cyan(o)} `)}
|
|
46
|
+
${i.cyan(d)}
|
|
47
|
+
`}}}).prompt()};`${i.gray(o)}`;var UD=Symbol.for("cancel");async function ZD(t,u={}){let e=r=>{if(typeof r!="symbol"||r.toString()!=="Symbol(clack:cancel)")return r;switch(u.cancel){case"reject":{let F=new Error("Prompt cancelled.");throw F.name="ConsolaPromptCancelledError",Error.captureStackTrace&&Error.captureStackTrace(F,ZD),F}case"undefined":return;case"null":return null;case"symbol":return UD;default:case"default":return u.default??u.initial}};if(!u.type||u.type==="text")return await GD({message:t,defaultValue:u.default,placeholder:u.placeholder,initialValue:u.initial}).then(e);if(u.type==="confirm")return await KD({message:t,initialValue:u.initial}).then(e);if(u.type==="select")return await YD({message:t,options:u.options.map(r=>typeof r=="string"?{value:r,label:r}:r),initialValue:u.initial}).then(e);if(u.type==="multiselect")return await JD({message:t,options:u.options.map(r=>typeof r=="string"?{value:r,label:r}:r),required:u.required,initialValues:u.initial}).then(e);throw new Error(`Unknown prompt type: ${u.type}`)}export{UD as kCancel,ZD as prompt};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as c__createRequire } from 'node:module';
|
|
2
2
|
const require = c__createRequire(import.meta.url);
|
|
3
|
-
import{i as t,k as l,l as c}from"./chunk-
|
|
3
|
+
import{i as t,k as l,l as c}from"./chunk-MJYEZ65F.js";import"./chunk-SQJLD7IF.js";import"./chunk-MCRDX3J3.js";import{createPublicKeys as a,getCleanPublicKey as n,zSharedConfig as o}from"@telia-ace/alliance-internal-node-utilities";var r={meta:{name:"public-key",description:t("command.public-key")},args:{type:{type:"string",required:!1,default:"spki",alias:"t",description:t("arg.public-key.type"),valueHint:"pkcs|spki|csp"},clean:{type:"boolean",required:!1,default:!1,alias:"c",description:t("arg.public-key.clean")},debug:l},run({args:i}){let e={clean:i.clean,type:i.type},p=a(o.pick({JWT_PUBLIC_CSP_KEY:!0,JWT_PRIVATE_KEY:!0}).parse({})),u=e.clean?n(e.type,p):p[e.type];c({debug:i.debug,input:e,output:u})}};export{r as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as c__createRequire } from 'node:module';
|
|
2
2
|
const require = c__createRequire(import.meta.url);
|
|
3
|
-
import{a as p,i as r,j as m,m as l,n as f,o as c}from"./chunk-
|
|
3
|
+
import{a as p,i as r,j as m,m as l,n as f,o as c}from"./chunk-MJYEZ65F.js";import{c as s}from"./chunk-SQJLD7IF.js";import"./chunk-MCRDX3J3.js";import{existsSync as d,readFileSync as h,rmSync as S}from"fs";import{start as x}from"@telia-ace/alliance-gateway/dev";import{createIndexHtml as b,getAppManifests as A}from"@telia-ace/alliance-internal-node-utilities";import{onExit as D}from"signal-exit";import y from"dns";import{createServer as g}from"vite";var w=process.env.CI==="true"||process.env.NODE_ENV==="test";async function v(e){let t=f("serve",e);y.setDefaultResultOrder("verbatim");let i=await g({plugins:e.vite.plugins,configFile:!1,mode:e.build.mode,server:{open:e.server.open,port:e.server.ports.server,host:"localhost",proxy:{"/-/":{target:`http://localhost:${e.server.ports.gateway}/`,prependPath:!1,rewrite:o=>o.replace("/-/","/")}},strictPort:!0},clearScreen:!1,resolve:{alias:e.vite.alias},define:t}).then(o=>o.listen());return(w?console.log:s.box)([r("info.server-url",{url:`http://localhost:${e.server.ports.server}`}),r("info.gateway-url",{url:`http://localhost:${e.server.ports.gateway}`}),r("info.stop-server")].join(`
|
|
4
4
|
`)),i}async function u(e){let t,i,o;D(()=>{if(t)try{t.close()}catch(n){s.error(n)}if(i&&d(i))try{S(i,{force:!0})}catch(n){s.error(n)}if(o)try{o.close()}catch(n){s.error(n)}});let a=await A(e.server.apps);d(e.entries.manifest)&&a.unshift(p(h(e.entries.manifest).toString())),t=await x(e,a),i=b(c(e)),o=await v(e)}var _={meta:{name:"serve",description:r("command.serve")},args:{"ports.server":{type:"string",description:r("arg.serve.ports.server"),required:!1},"ports.gateway":{type:"string",description:r("arg.serve.ports.gateway"),required:!1},"entries.app":{type:"string",valueHint:"./src/app.ts",description:r("arg.entries.app"),required:!1},"entries.manifest":{type:"string",valueHint:"./src/manifest.json",description:r("arg.entries.manifest"),required:!1},mode:{type:"string",alias:"m",description:r("arg.mode"),required:!1},logging:{type:"boolean",alias:"l",description:r("arg.serve.logging"),required:!1},open:{type:"boolean",alias:"o",description:r("arg.serve.open"),required:!1},config:m},async run({args:e}){let t=await l({command:"serve",mode:e.mode||"development"},e.config,{build:{mode:e.mode},server:{open:e.open,ports:{gateway:e["ports.gateway"]?Number(e["ports.gateway"]):void 0,server:e["ports.server"]?Number(e["ports.server"]):void 0},logging:e.logging},entries:{app:e["entries.app"],manifest:e["entries.manifest"]}});await u(t)}};export{_ as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as c__createRequire } from 'node:module';
|
|
2
|
+
const require = c__createRequire(import.meta.url);
|
|
3
|
+
import{a as _,b as F,c as P,d as N,e as H,f as E,g as z,h as B,i as p}from"./chunk-MJYEZ65F.js";import{c as A}from"./chunk-SQJLD7IF.js";import{a as C,c as D,e as me}from"./chunk-MCRDX3J3.js";var Q=D((Ie,K)=>{"use strict";var X=process.platform==="win32",he=X?"\\\\+":"\\/",G=X?"\\\\":"/",ye="((?:[^/]*(?:/|$))*)",we="([^/]*)",j=`((?:[^${G}]*(?:${G}|$))*)`,be=`([^${G}]*)`;function xe(e,{extended:r=!1,globstar:n=!1,strict:l=!1,filepath:t=!1,flags:s=""}={}){let c="",a="",g={regex:"",segments:[]},w=!1,d=!1,h=[];function o(f,{split:m,last:S,only:v}={}){v!=="path"&&(c+=f),t&&v!=="regex"&&(g.regex+=f==="\\/"?he:f,m?(S&&(a+=f),a!==""&&(s.includes("g")||(a=`^${a}$`),g.segments.push(new RegExp(a,s))),a=""):a+=f)}let i,u;for(let f=0;f<e.length;f++){if(i=e[f],u=e[f+1],["\\","$","^",".","="].includes(i)){o(`\\${i}`);continue}if(i==="/"){o(`\\${i}`,{split:!0}),u==="/"&&!l&&(c+="?");continue}if(i==="("){if(h.length){o(i);continue}o(`\\${i}`);continue}if(i===")"){if(h.length){o(i);let m=h.pop();o(m==="@"?"{1}":m==="!"?"([^/]*)":m);continue}o(`\\${i}`);continue}if(i==="|"){if(h.length){o(i);continue}o(`\\${i}`);continue}if(i==="+"){if(u==="("&&r){h.push(i);continue}o(`\\${i}`);continue}if(i==="@"&&r&&u==="("){h.push(i);continue}if(i==="!"){if(r){if(d){o("^");continue}if(u==="("){h.push(i),o("(?!"),f++;continue}o(`\\${i}`);continue}o(`\\${i}`);continue}if(i==="?"){if(r){u==="("?h.push(i):o(".");continue}o(`\\${i}`);continue}if(i==="["){if(d&&u===":"){f++;let m="";for(;e[++f]!==":";)m+=e[f];m==="alnum"?o("(\\w|\\d)"):m==="space"?o("\\s"):m==="digit"&&o("\\d"),f++;continue}if(r){d=!0,o(i);continue}o(`\\${i}`);continue}if(i==="]"){if(r){d=!1,o(i);continue}o(`\\${i}`);continue}if(i==="{"){if(r){w=!0,o("(");continue}o(`\\${i}`);continue}if(i==="}"){if(r){w=!1,o(")");continue}o(`\\${i}`);continue}if(i===","){if(w){o("|");continue}o(`\\${i}`);continue}if(i==="*"){if(u==="("&&r){h.push(i);continue}let m=e[f-1],S=1;for(;e[f+1]==="*";)S++,f++;let v=e[f+1];n?S>1&&(m==="/"||m===void 0)&&(v==="/"||v===void 0)?(o(ye,{only:"regex"}),o(j,{only:"path",last:!0,split:!0}),f++):(o(we,{only:"regex"}),o(be,{only:"path"})):o(".*");continue}o(i)}s.includes("g")||(c=`^${c}$`,a=`^${a}$`,t&&(g.regex=`^${g.regex}$`));let y={regex:new RegExp(c,s)};return t&&(g.segments.push(new RegExp(a,s)),g.regex=new RegExp(g.regex,s),g.globstar=new RegExp(s.includes("g")?j:`^${j}$`,s),y.path=g),y}K.exports=xe});var Z=D((Me,Y)=>{"use strict";var $e=C("os"),U=C("path"),ve=$e.platform()==="win32",Ce={"{":"}","(":")","[":"]"},Re=/\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\)|(\\).|([@?!+*]\(.*\)))/,Se=/\\(.)|(^!|[*?{}()[\]]|\(\?)/;function V(e,{strict:r=!0}={}){if(e==="")return!1;let n,l=r?Re:Se;for(;n=l.exec(e);){if(n[2])return!0;let t=n.index+n[0].length,s=n[1],c=s?Ce[s]:null;if(s&&c){let a=e.indexOf(c,t);a!==-1&&(t=a+1)}e=e.slice(t)}return!1}function Ae(e,{strict:r=!1}={}){ve&&e.includes("/")&&(e=e.split("\\").join("/")),/[\{\[].*[\/]*.*[\}\]]$/.test(e)&&(e+="/"),e+="a";do e=U.dirname(e);while(V(e,{strict:r})||/(^|[^\\])([\{\[]|\([^\)]+$)/.test(e));return e.replace(/\\([\*\?\|\[\]\(\)\{\}])/g,"$1")}function Pe(e,r={}){let n=Ae(e,r),l=V(e,r),t;return n!="."?(t=e.substr(n.length),t.startsWith("/")&&(t=t.substr(1))):t=e,l||(n=U.dirname(e),t=n!=="."?e.substr(n.length):e),t.startsWith("./")&&(t=t.substr(2)),t.startsWith("/")&&(t=t.substr(1)),{base:n,glob:t,isGlob:l}}Y.exports=Pe});var ie=D((Fe,te)=>{"use strict";var I=C("fs"),Ee=Q(),{promisify:ee}=C("util"),ze=Z(),{join:q,resolve:J,relative:Oe}=C("path"),ke=/(^|[\\\/])\.[^\\\/\.]/g,We=ee(I.readdir),Te=ee(I.stat),L={};async function ne(e,r,n,l,t="",s=0){let c=n.segments[s],a=J(l.cwd,r,t),g=await We(a),{dot:w,filesOnly:d}=l,h=0,o=g.length,i,u,y,f,m;for(;h<o;h++)if(u=q(a,i=g[h]),y=t?q(t,i):i,!(!w&&ke.test(y))){if(m=n.regex.test(y),(f=L[y])===void 0&&(L[y]=f=I.lstatSync(u)),!f.isDirectory()){m&&e.push(Oe(l.cwd,u));continue}c&&!c.test(i)||(!d&&m&&e.push(q(r,y)),await ne(e,r,n,l,y,c&&c.toString()!==n.globstar&&s+1))}}te.exports=async function(e,r={}){if(!e)return[];let n=ze(e);if(r.cwd=r.cwd||".",!n.isGlob)try{let s=J(r.cwd,e),c=await Te(s);return r.filesOnly&&!c.isFile()?[]:r.absolute?[s]:[e]}catch(s){if(s.code!="ENOENT")throw s;return[]}r.flush&&(L={});let l=[],{path:t}=Ee(n.glob,{filepath:!0,globstar:!0,extended:!0});return t.globstar=t.globstar.toString(),await ne(l,n.base,t,r,".",0),r.absolute?l.map(s=>J(r.cwd,s)):l}});import{existsSync as O,readFileSync as W,writeFileSync as De}from"fs";import{dirname as _e,relative as se,resolve as x,sep as M}from"path";var le=me(ie(),1);import Ne from"detect-indent";import{loadFile as je}from"magicast";import{getDefaultExportOptions as Ge}from"magicast/helpers";import{run as qe}from"npm-check-updates";function b(...e){let r=" ";return(n,l)=>e.reduce((t,s)=>typeof s=="number"?`${new Array(s).fill(r).join("")}${t}`:typeof s=="string"?`${s}${t}`:s(t),B.includes(n)?p(n,l):n)}async function ce(e){let r=await qe({deep:!0,cwd:process.cwd(),filter:n=>n.startsWith($)||n.startsWith(R)||["typescript","vite"].includes(n),target:n=>(n.startsWith($)||n.startsWith(R))&&e?"@next":"@latest"});return r||(A.error(p("errors.npm-error")),process.exit(1)),Promise.all(Object.entries(r).filter(([n])=>{try{return W(x(n)).toString().includes($)}catch{return!1}}).map(async([n,l])=>{let t=x(_e(n)),s=x(t,"tsconfig.json"),c=x(t,"package.json"),a=x(t,".npmrc"),[g]=await(0,le.default)(`${oe(t)}/alliance.config*`);return{path:oe(se(process.cwd(),t)),packageJson:O(c)?k(c,t):void 0,tsConfigJson:O(s)?k(s,t):void 0,allianceConfig:O(g)?k(g,t):void 0,npmConfig:O(a)?k(a,t):void 0,upgrades:l}}))}async function ae({tsConfigJson:e}){if(!e)return;let{warn:r,error:n,output:l}=T(e.relative);try{let t=_(W(e.full).toString());t?.compilerOptions?.moduleResolution?.toLowerCase()!=="bundler"&&r(p("warnings.change",{property:"compilerOptions.moduleResolution",current:t?.compilerOptions?.moduleResolution,new:"bundler"}))}catch(t){n(t)}l()}async function fe({npmConfig:e}){let{error:r,output:n,recommend:l}=T(e?.relative||".npmrc");if(!e)l(p("recommendations.add.webprovisions-registry-config"));else try{W(e.full).toString().includes(`${ge}:registry=https://registry.webprovisions.io`)||l(p("recommendations.update.webprovisions-registry-config"))}catch(t){r(t)}n()}async function ue({allianceConfig:e}){if(!e)return;let{warn:r,error:n,output:l}=T(e.relative,!1);try{let t=await je(e.full),s=Ge(t);typeof s?.experimental?.logging=="boolean"&&r(p("warnings.remove",{property:"experimental.logging",alt:`, use ${P("'server.logging'")} instead`})),typeof s?.server?.mode<"u"&&r(p("warnings.remove",{property:"server.mode",alt:", no longer supported"}))}catch(t){n(t)}l()}async function pe({packageJson:e,allianceConfig:r,tsConfigJson:n,upgrades:l}){if(!e)return;let{change:t,warn:s,output:c,error:a,recommend:g}=T(e.relative,!!r||!!n);try{let w=W(e.full).toString(),d=_(w);if(d.publishConfig?.registry!=="https://registry.webprovisions.io"&&s(p("warnings.set",{property:"publishConfig.registry",new:"https://registry.webprovisions.io"})),d.publishConfig?.access!=="public"&&s(p("warnings.set",{property:"publishConfig.access",new:"public"})),d.alliance?.apps&&s(p("warnings.remove",{property:"alliance.apps",alt:`, use the app config ${P("'server.apps'")} option instead`})),d.scripts){let o=Object.entries(d.scripts).filter(([i,u])=>u.includes("create alliance")||u.includes("create-alliance"));for(let[i,u]of o)try{u.includes("serve")||u.includes("server")?(s(p("warnings.change",{property:`scripts.${i}`,current:u,new:"npx @telia-ace/alliance-cli serve"})),u.includes("--server-mode")&&s(p("warnings.remove",{property:"--server-mode",alt:", no longer supported"}))):u.includes("build")&&s(p("warnings.change",{property:`scripts.${i}`,current:u,new:"npx @telia-ace/alliance-cli build"}))}catch(y){a(y)}}for(let o of Object.keys({...d?.dependencies,...d?.devDependencies})){if(!o.startsWith(re))continue;let i=o.replace(re,"");g(p("recommendations.update.webprovisions-registry-app",{pkg:o,wpPkg:`${R}${i}`}))}let h=o=>{if(o)for(let i of Object.keys(o))!i.startsWith($)&&!i.startsWith(R)||!l[i]||(o[i]=l[i])};h(d.dependencies),h(d.devDependencies);for(let[o,i]of Object.entries(l))o.startsWith($)||o.startsWith(R)?t(p("changes.upgraded",{pkg:o,v:i})):g(p("recommendations.upgrade",{pkg:o,v:i}));De(e.full,JSON.stringify(d,null,Ne(w).indent))}catch(w){a(w)}c()}var $="@telia-ace",ge="@webprovisions-registry",re=`${$}/alliance-app-`,R=`${ge}/alliance-app-`;function T(e,r=!0){let n=[],l=[],t=[],s=[];return{warn:c=>l.push(c),change:c=>n.push(c),recommend:c=>t.push(c),error:c=>s.push(c),output:()=>{if(!n.length&&!l.length&&!t.length)return;console.log(b(H,1)(e));let c=b("- ",2);if(n.length){console.log(b(2,P)("info.header.changes"));for(let a of n)console.log(c(a))}if(l.length){console.log(b(2,N)("info.header.warnings"));for(let a of l)console.log(c(a))}if(t.length){console.log(b(2,F)("info.header.recommendations"));for(let a of t)console.log(c(a))}if(s.length){console.log(b(2,N)("Errors"));for(let a of s)A.error(c(a))}r&&console.log()}}}function oe(e){return e.replaceAll(M,"/")}function k(e,r=process.cwd()){let n=x(process.cwd(),e);return{full:n.replaceAll(M,"/"),relative:se(r,n).replaceAll(M,"/")}}function de(){let e=Je();return A.log(b(z,E)("info.next-steps")),console.log([p("info.steps.warnings"),p("info.steps.install",{cmd:`${e} install`})].map(r=>b("- ",1)(r)).join(`
|
|
4
|
+
`))}function Je(){try{if(!process.env.npm_config_user_agent)return"npm";let r=process.env.npm_config_user_agent.split(" ")[0],n=r.lastIndexOf("/"),l=r.substring(0,n);return l==="npminstall"?"cnpm":l}catch{return"npm"}}var rn={meta:{name:"upgrade",description:p("command.upgrade")},args:{next:{type:"boolean",description:p("arg.upgrade.next"),default:!1,required:!1,alias:"n"}},async run(e){let r=await ce(e.args.next);for(let n of r)console.log(),console.log(b(z,E)(n.path||"root")),await fe(n),await pe(n),await ae(n),await ue(n);console.log(),de(),console.log()}};export{rn as default};
|