@telia-ace/alliance-cli 1.1.3 → 2.0.0-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,4 +22,4 @@ var FD=Object.create;var L=Object.defineProperty;var tD=Object.getOwnPropertyDes
22
22
  `+e.join(`
23
23
  `):""),u.type==="trace"){let g=new Error("Trace: "+u.message);c+=this.formatStack(g.stack||"")}return s?`
24
24
  `+c+`
25
- `:c}};function I(F){return F.replace(/`([^`]+)`/gm,(u,t)=>a.cyan(t)).replace(/\s+_([^_]+)_\s+/gm,(u,t)=>` ${a.underline(t)} `)}function YD(F="white"){return a[F]||a.white}function VD(F="bgWhite"){return a[`bg${F[0].toUpperCase()}${F.slice(1)}`]||a.bgWhite}function zD(F={}){let u=ZD();return process.env.CONSOLA_LEVEL&&(u=Number.parseInt(process.env.CONSOLA_LEVEL)??u),W({level:u,defaults:{level:u},stdout:process.stdout,stderr:process.stderr,prompt:(...r)=>import("./prompt-KMUWEOPT.js").then(e=>e.prompt(...r)),reporters:F.reporters||[F.fancy??!(X||$)?new M:new m],...F})}function ZD(){return SD?C.debug:$?C.warn:C.info}var Eu=zD();export{HD as a,KD as b,JD as c,jD as d,qD as e,XD as f,a as g,H as h,eu as i,ND as j,kD as k,Eu as l};
25
+ `:c}};function I(F){return F.replace(/`([^`]+)`/gm,(u,t)=>a.cyan(t)).replace(/\s+_([^_]+)_\s+/gm,(u,t)=>` ${a.underline(t)} `)}function YD(F="white"){return a[F]||a.white}function VD(F="bgWhite"){return a[`bg${F[0].toUpperCase()}${F.slice(1)}`]||a.bgWhite}function zD(F={}){let u=ZD();return process.env.CONSOLA_LEVEL&&(u=Number.parseInt(process.env.CONSOLA_LEVEL)??u),W({level:u,defaults:{level:u},stdout:process.stdout,stderr:process.stderr,prompt:(...r)=>import("./prompt-XHIHFZ5S.js").then(e=>e.prompt(...r)),reporters:F.reporters||[F.fancy??!(X||$)?new M:new m],...F})}function ZD(){return SD?C.debug:$?C.warn:C.info}var Eu=zD();export{HD as a,KD as b,JD as c,jD as d,qD as e,XD as f,a as g,H as h,eu as i,ND as j,kD as k,Eu as l};
@@ -0,0 +1,7 @@
1
+ import { createRequire as c__createRequire } from 'node:module';
2
+ const require = c__createRequire(import.meta.url);
3
+ import{g,l as p}from"./chunk-2GL2UYTF.js";function U(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function y(e,n=""){let t=[];for(let o of e)for(let[a,r]of o.entries())t[a]=Math.max(t[a]||0,r.length);return e.map(o=>o.map((a,r)=>n+a[r===0?"padStart":"padEnd"](t[r])).join(" ")).join(`
4
+ `)}function m(e){return typeof e=="function"?e():e}var w=class extends Error{constructor(n,t){super(n),this.code=t,this.name="CLIError"}},_=/\d/,j=["-","_","/","."];function S(e=""){if(!_.test(e))return e!==e.toLowerCase()}function v(e,n){let t=n??j,o=[];if(!e||typeof e!="string")return o;let a="",r,l;for(let i of e){let s=t.includes(i);if(s===!0){o.push(a),a="",r=void 0;continue}let u=S(i);if(l===!1){if(r===!1&&u===!0){o.push(a),a=i,r=u;continue}if(r===!0&&u===!1&&a.length>1){let c=a.at(-1);o.push(a.slice(0,Math.max(0,a.length-1))),a=c+i,r=u;continue}}a+=i,r=u,l=s}return o.push(a),o}function E(e){return e?e[0].toUpperCase()+e.slice(1):""}function R(e){return e?e[0].toLowerCase()+e.slice(1):""}function k(e,n){return e?(Array.isArray(e)?e:v(e)).map(t=>E(n?.normalize?t.toLowerCase():t)).join(""):""}function q(e,n){return R(k(e||"",n))}function I(e,n){return e?(Array.isArray(e)?e:v(e)).map(t=>t.toLowerCase()).join(n??"-"):""}function x(e){return e==null?[]:Array.isArray(e)?e:[e]}function H(e,n,t,o){let a,r=e[n],l=~o.string.indexOf(n)?t==null||t===!0?"":String(t):typeof t=="boolean"?t:~o.boolean.indexOf(n)?t==="false"?!1:t==="true"||(e._.push((a=+t,a*0===0?a:t)),!!t):(a=+t,a*0===0?a:t);e[n]=r==null?l:Array.isArray(r)?r.concat(l):[r,l]}function T(e=[],n={}){let t,o,a,r,l,i={_:[]},s=0,u=0,c=0,A=e.length,C=n.alias!==void 0,f=n.unknown!==void 0,d=n.default!==void 0;if(n.alias=n.alias||{},n.string=x(n.string),n.boolean=x(n.boolean),C)for(t in n.alias)for(o=n.alias[t]=x(n.alias[t]),s=0;s<o.length;s++)(n.alias[o[s]]=o.concat(t)).splice(s,1);for(s=n.boolean.length;s-- >0;)for(o=n.alias[n.boolean[s]]||[],u=o.length;u-- >0;)n.boolean.push(o[u]);for(s=n.string.length;s-- >0;)for(o=n.alias[n.string[s]]||[],u=o.length;u-- >0;)n.string.push(o[u]);if(d){for(t in n.default)if(r=typeof n.default[t],o=n.alias[t]=n.alias[t]||[],n[r]!==void 0)for(n[r].push(t),s=0;s<o.length;s++)n[r].push(o[s])}let h=f?Object.keys(n.alias):[];for(s=0;s<A;s++){if(a=e[s],a==="--"){i._=i._.concat(e.slice(++s));break}for(u=0;u<a.length&&a.charCodeAt(u)===45;u++);if(u===0)i._.push(a);else if(a.substring(u,u+3)==="no-"){if(r=a.slice(Math.max(0,u+3)),f&&!~h.indexOf(r))return n.unknown(a);i[r]=!1}else{for(c=u+1;c<a.length&&a.charCodeAt(c)!==61;c++);for(r=a.substring(u,c),l=a.slice(Math.max(0,++c))||s+1===A||(""+e[s+1]).charCodeAt(0)===45||e[++s],o=u===2?[r]:r,c=0;c<o.length;c++){if(r=o[c],f&&!~h.indexOf(r))return n.unknown("-".repeat(u)+r);H(i,r,c+1<o.length||l,n)}}}if(d)for(t in n.default)i[t]===void 0&&(i[t]=n.default[t]);if(C)for(t in i)for(o=n.alias[t]||[];o.length>0;)i[o.shift()]=i[t];return i}function P(e,n){let t={boolean:[],string:[],mixed:[],alias:{},default:{}},o=O(n);for(let i of o)i.type!=="positional"&&(i.type==="string"?t.string.push(i.name):i.type==="boolean"&&t.boolean.push(i.name),i.default!==void 0&&(t.default[i.name]=i.default),i.alias&&(t.alias[i.name]=i.alias));let a=T(e,t),[...r]=a._,l=new Proxy(a,{get(i,s){return i[s]??i[q(s)]??i[I(s)]}});for(let[,i]of o.entries())if(i.type==="positional"){let s=r.shift();if(s!==void 0)l[i.name]=s;else{if(i.default===void 0&&i.required!==!1)throw new w(`Missing required positional argument: ${i.name.toUpperCase()}`,"EARG");l[i.name]=i.default}}else if(i.required&&l[i.name]===void 0)throw new w(`Missing required argument: --${i.name}`,"EARG");return l}function O(e){let n=[];for(let[t,o]of Object.entries(e||{}))n.push({...o,name:t,alias:U(o.alias)});return n}async function N(e,n){let t=await m(e.args||{}),o=P(n.rawArgs,t),a={rawArgs:n.rawArgs,args:o,data:n.data,cmd:e};typeof e.setup=="function"&&await e.setup(a);let r;try{let l=await m(e.subCommands);if(l&&Object.keys(l).length>0){let i=n.rawArgs.findIndex(u=>!u.startsWith("-")),s=n.rawArgs[i];if(s){if(!l[s])throw new w(`Unknown command \`${s}\``,"E_UNKNOWN_COMMAND");let u=await m(l[s]);u&&await N(u,{rawArgs:n.rawArgs.slice(i+1)})}else if(!e.run)throw new w("No command specified.","E_NO_COMMAND")}typeof e.run=="function"&&(r=await e.run(a))}finally{typeof e.cleanup=="function"&&await e.cleanup(a)}return{result:r}}async function $(e,n,t){let o=await m(e.subCommands);if(o&&Object.keys(o).length>0){let a=n.findIndex(i=>!i.startsWith("-")),r=n[a],l=await m(o[r]);if(l)return $(l,n.slice(a+1),e)}return[e,t]}async function D(e,n){try{p.log(await G(e,n)+`
5
+ `)}catch(t){p.error(t)}}async function G(e,n){let t=await m(e.meta||{}),o=O(await m(e.args||{})),a=await m(n?.meta||{}),r=`${a.name?`${a.name} `:""}`+(t.name||process.argv[1]),l=[],i=[],s=[],u=[];for(let f of o)if(f.type==="positional"){let d=f.name.toUpperCase(),h=f.required!==!1&&f.default===void 0,b=f.default?`="${f.default}"`:"";i.push(["`"+d+b+"`",f.description||"",f.valueHint?`<${f.valueHint}>`:""]),u.push(h?`<${d}>`:`[${d}]`)}else{let d=f.required===!0&&f.default===void 0,h=(f.type==="boolean"&&f.default===!0?[...(f.alias||[]).map(b=>`--no-${b}`),`--no-${f.name}`].join(", "):[...(f.alias||[]).map(b=>`-${b}`),`--${f.name}`].join(", "))+(f.type==="string"&&(f.valueHint||f.default)?`=${f.valueHint?`<${f.valueHint}>`:`"${f.default||""}"`}`:"");l.push(["`"+h+(d?" (required)":"")+"`",f.description||""]),d&&u.push(h)}if(e.subCommands){let f=[],d=await m(e.subCommands);for(let[h,b]of Object.entries(d)){let M=await m(b),L=await m(M?.meta);s.push([`\`${h}\``,L?.description||""]),f.push(h)}u.push(f.join("|"))}let c=[],A=t.version||a.version;c.push(g.gray(`${t.description} (${r+(A?` v${A}`:"")})`),"");let C=l.length>0||i.length>0;return c.push(`${g.underline(g.bold("USAGE"))} \`${r}${C?" [OPTIONS]":""} ${u.join(" ")}\``,""),i.length>0&&(c.push(g.underline(g.bold("ARGUMENTS")),""),c.push(y(i," ")),c.push("")),l.length>0&&(c.push(g.underline(g.bold("OPTIONS")),""),c.push(y(l," ")),c.push("")),s.length>0&&(c.push(g.underline(g.bold("COMMANDS")),""),c.push(y(s," ")),c.push("",`Use \`${r} <command> --help\` for more information about a command.`)),c.filter(f=>typeof f=="string").join(`
6
+ `)}async function ee(e,n={}){let t=n.rawArgs||process.argv.slice(2),o=n.showUsage||D;try{if(t.includes("--help")||t.includes("-h"))await o(...await $(e,t)),process.exit(0);else if(t.length===1&&t[0]==="--version"){let a=typeof e.meta=="function"?await e.meta():await e.meta;if(!a?.version)throw new w("No version specified","E_NO_VERSION");p.log(a.version)}else await N(e,{rawArgs:t})}catch(a){let r=a instanceof w;r||p.error(a,`
7
+ `),r&&await o(...await $(e,t)),p.error(a.message),process.exit(1)}}export{ee as a};
@@ -0,0 +1,8 @@
1
+ import { createRequire as c__createRequire } from 'node:module';
2
+ const require = c__createRequire(import.meta.url);
3
+ import{h as R,i as Oe,l as $}from"./chunk-2GL2UYTF.js";import{existsSync as L,readFileSync as dt}from"node:fs";import{relative as Ae,resolve as V}from"node:path";var b;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let a={};for(let i of s)a[i]=i;return a},t.getValidEnumValues=s=>{let a=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(let o of a)i[o]=s[o];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(a){return s[a]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let a=[];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},t.find=(s,a)=>{for(let i of s)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(b||(b={}));var Re;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Re||(Re={}));var f=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),D=t=>{switch(typeof t){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(t)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(t)?f.array:t===null?f.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?f.promise:typeof Map<"u"&&t instanceof Map?f.map:typeof Set<"u"&&t instanceof Set?f.set:typeof Date<"u"&&t instanceof Date?f.date:f.object;default:return f.unknown}},c=b.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"]),lt=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),T=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(a){return a.message},n={_errors:[]},s=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,l=0;for(;l<i.path.length;){let d=i.path[l];l===i.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(r(i))):o[d]=o[d]||{_errors:[]},o=o[d],l++}}};return s(this),n}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,b.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};T.create=t=>new T(t);var de=(t,e)=>{let r;switch(t.code){case c.invalid_type:t.received===f.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case c.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,b.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:r=`Unrecognized key(s) in object: ${b.joinValues(t.keys,", ")}`;break;case c.invalid_union:r="Invalid input";break;case c.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${b.joinValues(t.options)}`;break;case c.invalid_enum_value:r=`Invalid enum value. Expected ${b.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}"`:b.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,b.assertNever(t)}return{message:r}},qe=de;function ft(t){qe=t}function ke(){return qe}var Te=t=>{let{data:e,path:r,errorMaps:n,issueData:s}=t,a=[...r,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="",l=n.filter(d=>!!d).slice().reverse();for(let d of l)o=d(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}},pt=[];function u(t,e){let r=ke(),n=Te({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===de?void 0:de].filter(s=>!!s)});t.common.issues.push(n)}var x=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 n=[];for(let s of r){if(s.status==="aborted")return m;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r){let a=await s.key,i=await s.value;n.push({key:a,value:i})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}},m=Object.freeze({status:"aborted"}),ce=t=>({status:"dirty",value:t}),w=t=>({status:"valid",value:t}),$e=t=>t.status==="aborted",Pe=t=>t.status==="dirty",ye=t=>t.status==="valid",ve=t=>typeof Promise<"u"&&t instanceof Promise;function Ce(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function Je(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r}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 me,ge,N=class{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},We=(t,e)=>{if(ye(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 T(t.common.issues);return this._error=r,this._error}}};function v(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{var l,d;let{message:y}=t;return i.code==="invalid_enum_value"?{message:y??o.defaultError}:typeof o.data>"u"?{message:(l=y??n)!==null&&l!==void 0?l:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(d=y??r)!==null&&d!==void 0?d:o.defaultError}},description:s}}var _=class{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)}get description(){return this._def.description}_getType(e){return D(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:D(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new x,ctx:{common:e.parent.common,data:e.data,parsedType:D(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(ve(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 n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let s={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:D(e)},a=this._parseSync({data:e,path:s.path,parent:s});return We(s,a)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:D(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(ve(s)?s:Promise.resolve(s));return We(n,a)}refine(e,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,a)=>{let i=e(s),o=()=>a.addIssue({code:c.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new C({schema:this,typeName:h.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return E.create(this,this._def)}nullable(){return I.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return M.create(this,this._def)}promise(){return W.create(this,this._def)}or(e){return K.create([this,e],this._def)}and(e){return X.create(this,e,this._def)}transform(e){return new C({...v(this._def),schema:this,typeName:h.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new ne({...v(this._def),innerType:this,defaultValue:r,typeName:h.ZodDefault})}brand(){return new _e({typeName:h.ZodBranded,type:this,...v(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new se({...v(this._def),innerType:this,catchValue:r,typeName:h.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return be.create(this,e)}readonly(){return ae.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ht=/^c[^\s-]{8,}$/i,mt=/^[0-9a-z]+$/,gt=/^[0-9A-HJKMNP-TV-Z]{26}$/,yt=/^[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,vt=/^[a-z0-9_-]{21}$/i,_t=/^[-+]?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)?)??$/,bt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,xt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ie,wt=/^(?:(?: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=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Tt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Fe="((\\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])))",Ct=new RegExp(`^${Fe}$`);function He(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function St(t){return new RegExp(`^${He(t)}$`)}function Ye(t){let e=`${Fe}T${He(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 Et(t,e){return!!((e==="v4"||!e)&&wt.test(t)||(e==="v6"||!e)&&kt.test(t))}var z=class t extends _{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){let a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_type,expected:f.string,received:a.parsedType}),m}let n=new x,s;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?u(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&u(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")bt.test(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{validation:"email",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Ie||(Ie=new RegExp(xt,"u")),Ie.test(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{validation:"emoji",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")yt.test(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{validation:"uuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")vt.test(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{validation:"nanoid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")ht.test(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{validation:"cuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")mt.test(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{validation:"cuid2",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")gt.test(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{validation:"ulid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),u(s,{validation:"url",code:c.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{validation:"regex",code:c.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),u(s,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.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)||(s=this._getOrReturnCtx(e,s),u(s,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),u(s,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Ye(a).test(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{code:c.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Ct.test(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{code:c.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?St(a).test(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{code:c.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?_t.test(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{validation:"duration",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Et(e.data,a.version)||(s=this._getOrReturnCtx(e,s),u(s,{validation:"ip",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Tt.test(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{validation:"base64",code:c.invalid_string,message:a.message}),n.dirty()):b.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:c.invalid_string,...p.errToObj(n)})}_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)})}ip(e){return this._addCheck({kind:"ip",...p.errToObj(e)})}datetime(e){var r,n;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:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(n=e?.local)!==null&&n!==void 0?n:!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 isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}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}};z.create=t=>{var e;return new z({checks:[],typeName:h.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...v(t)})};function Nt(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,a=parseInt(t.toFixed(s).replace(".","")),i=parseInt(e.toFixed(s).replace(".",""));return a%i/Math.pow(10,s)}var q=class t extends _{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)!==f.number){let a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_type,expected:f.number,received:a.parsedType}),m}let n,s=new x;for(let a of this._def.checks)a.kind==="int"?b.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),u(n,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),u(n,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?Nt(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),u(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{code:c.not_finite,message:a.message}),s.dirty()):b.assertNever(a);return{status:s.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,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:p.toString(s)}]})}_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"&&b.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};q.create=t=>new q({checks:[],typeName:h.ZodNumber,coerce:t?.coerce||!1,...v(t)});var J=class t extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==f.bigint){let a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_type,expected:f.bigint,received:a.parsedType}),m}let n,s=new x;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),u(n,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),u(n,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),u(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):b.assertNever(a);return{status:s.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,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:p.toString(s)}]})}_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}};J.create=t=>{var e;return new J({checks:[],typeName:h.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...v(t)})};var F=class extends _{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){let n=this._getOrReturnCtx(e);return u(n,{code:c.invalid_type,expected:f.boolean,received:n.parsedType}),m}return w(e.data)}};F.create=t=>new F({typeName:h.ZodBoolean,coerce:t?.coerce||!1,...v(t)});var H=class t extends _{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){let a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_type,expected:f.date,received:a.parsedType}),m}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_date}),m}let n=new x,s;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):b.assertNever(a);return{status:n.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}};H.create=t=>new H({checks:[],coerce:t?.coerce||!1,typeName:h.ZodDate,...v(t)});var ue=class extends _{_parse(e){if(this._getType(e)!==f.symbol){let n=this._getOrReturnCtx(e);return u(n,{code:c.invalid_type,expected:f.symbol,received:n.parsedType}),m}return w(e.data)}};ue.create=t=>new ue({typeName:h.ZodSymbol,...v(t)});var Y=class extends _{_parse(e){if(this._getType(e)!==f.undefined){let n=this._getOrReturnCtx(e);return u(n,{code:c.invalid_type,expected:f.undefined,received:n.parsedType}),m}return w(e.data)}};Y.create=t=>new Y({typeName:h.ZodUndefined,...v(t)});var G=class extends _{_parse(e){if(this._getType(e)!==f.null){let n=this._getOrReturnCtx(e);return u(n,{code:c.invalid_type,expected:f.null,received:n.parsedType}),m}return w(e.data)}};G.create=t=>new G({typeName:h.ZodNull,...v(t)});var U=class extends _{constructor(){super(...arguments),this._any=!0}_parse(e){return w(e.data)}};U.create=t=>new U({typeName:h.ZodAny,...v(t)});var Z=class extends _{constructor(){super(...arguments),this._unknown=!0}_parse(e){return w(e.data)}};Z.create=t=>new Z({typeName:h.ZodUnknown,...v(t)});var A=class extends _{_parse(e){let r=this._getOrReturnCtx(e);return u(r,{code:c.invalid_type,expected:f.never,received:r.parsedType}),m}};A.create=t=>new A({typeName:h.ZodNever,...v(t)});var le=class extends _{_parse(e){if(this._getType(e)!==f.undefined){let n=this._getOrReturnCtx(e);return u(n,{code:c.invalid_type,expected:f.void,received:n.parsedType}),m}return w(e.data)}};le.create=t=>new le({typeName:h.ZodVoid,...v(t)});var M=class t extends _{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==f.array)return u(r,{code:c.invalid_type,expected:f.array,received:r.parsedType}),m;if(s.exactLength!==null){let i=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(i||o)&&(u(r,{code:i?c.too_big:c.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(u(r,{code:c.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(u(r,{code:c.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>s.type._parseAsync(new N(r,i,r.path,o)))).then(i=>x.mergeArray(n,i));let a=[...r.data].map((i,o)=>s.type._parseSync(new N(r,i,r.path,o)));return x.mergeArray(n,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)}};M.create=(t,e)=>new M({type:t,minLength:null,maxLength:null,exactLength:null,typeName:h.ZodArray,...v(e)});function oe(t){if(t instanceof k){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=E.create(oe(n))}return new k({...t._def,shape:()=>e})}else return t instanceof M?new M({...t._def,type:oe(t.element)}):t instanceof E?E.create(oe(t.unwrap())):t instanceof I?I.create(oe(t.unwrap())):t instanceof O?O.create(t.items.map(e=>oe(e))):t}var k=class t extends _{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=b.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==f.object){let d=this._getOrReturnCtx(e);return u(d,{code:c.invalid_type,expected:f.object,received:d.parsedType}),m}let{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof A&&this._def.unknownKeys==="strip"))for(let d in s.data)i.includes(d)||o.push(d);let l=[];for(let d of i){let y=a[d],S=s.data[d];l.push({key:{status:"valid",value:d},value:y._parse(new N(s,S,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof A){let d=this._def.unknownKeys;if(d==="passthrough")for(let y of o)l.push({key:{status:"valid",value:y},value:{status:"valid",value:s.data[y]}});else if(d==="strict")o.length>0&&(u(s,{code:c.unrecognized_keys,keys:o}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let y of o){let S=s.data[y];l.push({key:{status:"valid",value:y},value:d._parse(new N(s,S,s.path,y)),alwaysSet:y in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let d=[];for(let y of l){let S=await y.key,Ue=await y.value;d.push({key:S,value:Ue,alwaysSet:y.alwaysSet})}return d}).then(d=>x.mergeObjectSync(n,d)):x.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return p.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var s,a,i,o;let l=(i=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(o=p.errToObj(e).message)!==null&&o!==void 0?o:l}:{message:l}}}:{}})}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:h.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return b.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return b.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return oe(this)}partial(e){let r={};return b.objectKeys(this.shape).forEach(n=>{let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return b.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof E;)a=a._def.innerType;r[n]=a}}),new t({...this._def,shape:()=>r})}keyof(){return Ge(b.objectKeys(this.shape))}};k.create=(t,e)=>new k({shape:()=>t,unknownKeys:"strip",catchall:A.create(),typeName:h.ZodObject,...v(e)});k.strictCreate=(t,e)=>new k({shape:()=>t,unknownKeys:"strict",catchall:A.create(),typeName:h.ZodObject,...v(e)});k.lazycreate=(t,e)=>new k({shape:t,unknownKeys:"strip",catchall:A.create(),typeName:h.ZodObject,...v(e)});var K=class extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(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 T(o.ctx.common.issues));return u(r,{code:c.invalid_union,unionErrors:i}),m}if(r.common.async)return Promise.all(n.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(s);{let a,i=[];for(let l of n){let d={...r,common:{...r.common,issues:[]},parent:null},y=l._parseSync({data:r.data,path:r.path,parent:d});if(y.status==="valid")return y;y.status==="dirty"&&!a&&(a={result:y,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(l=>new T(l));return u(r,{code:c.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}};K.create=(t,e)=>new K({options:t,typeName:h.ZodUnion,...v(e)});var P=t=>t instanceof Q?P(t.schema):t instanceof C?P(t.innerType()):t instanceof ee?[t.value]:t instanceof te?t.options:t instanceof re?b.objectValues(t.enum):t instanceof ne?P(t._def.innerType):t instanceof Y?[void 0]:t instanceof G?[null]:t instanceof E?[void 0,...P(t.unwrap())]:t instanceof I?[null,...P(t.unwrap())]:t instanceof _e||t instanceof ae?P(t.unwrap()):t instanceof se?P(t._def.innerType):[],Se=class t extends _{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==f.object)return u(r,{code:c.invalid_type,expected:f.object,received:r.parsedType}),m;let n=this.discriminator,s=r.data[n],a=this.optionsMap.get(s);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}):(u(r,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=new Map;for(let a of r){let i=P(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(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,a)}}return new t({typeName:h.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...v(n)})}};function Ze(t,e){let r=D(t),n=D(e);if(t===e)return{valid:!0,data:t};if(r===f.object&&n===f.object){let s=b.objectKeys(e),a=b.objectKeys(t).filter(o=>s.indexOf(o)!==-1),i={...t,...e};for(let o of a){let l=Ze(t[o],e[o]);if(!l.valid)return{valid:!1};i[o]=l.data}return{valid:!0,data:i}}else if(r===f.array&&n===f.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let a=0;a<t.length;a++){let i=t[a],o=e[a],l=Ze(i,o);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return r===f.date&&n===f.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var X=class extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=(a,i)=>{if($e(a)||$e(i))return m;let o=Ze(a.value,i.value);return o.valid?((Pe(a)||Pe(i))&&r.dirty(),{status:r.value,value:o.data}):(u(n,{code:c.invalid_intersection_types}),m)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};X.create=(t,e,r)=>new X({left:t,right:e,typeName:h.ZodIntersection,...v(r)});var O=class t extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.array)return u(n,{code:c.invalid_type,expected:f.array,received:n.parsedType}),m;if(n.data.length<this._def.items.length)return u(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&n.data.length>this._def.items.length&&(u(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new N(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>x.mergeArray(r,i)):x.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};O.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new O({items:t,typeName:h.ZodTuple,rest:null,...v(e)})};var Ee=class t extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.object)return u(n,{code:c.invalid_type,expected:f.object,received:n.parsedType}),m;let s=[],a=this._def.keyType,i=this._def.valueType;for(let o in n.data)s.push({key:a._parse(new N(n,o,n.path,o)),value:i._parse(new N(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?x.mergeObjectAsync(r,s):x.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof _?new t({keyType:e,valueType:r,typeName:h.ZodRecord,...v(n)}):new t({keyType:z.create(),valueType:e,typeName:h.ZodRecord,...v(r)})}},fe=class extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.map)return u(n,{code:c.invalid_type,expected:f.map,received:n.parsedType}),m;let s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,l],d)=>({key:s._parse(new N(n,o,n.path,[d,"key"])),value:a._parse(new N(n,l,n.path,[d,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of i){let d=await l.key,y=await l.value;if(d.status==="aborted"||y.status==="aborted")return m;(d.status==="dirty"||y.status==="dirty")&&r.dirty(),o.set(d.value,y.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let l of i){let d=l.key,y=l.value;if(d.status==="aborted"||y.status==="aborted")return m;(d.status==="dirty"||y.status==="dirty")&&r.dirty(),o.set(d.value,y.value)}return{status:r.value,value:o}}}};fe.create=(t,e,r)=>new fe({valueType:e,keyType:t,typeName:h.ZodMap,...v(r)});var pe=class t extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.set)return u(n,{code:c.invalid_type,expected:f.set,received:n.parsedType}),m;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(u(n,{code:c.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(u(n,{code:c.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let a=this._def.valueType;function i(l){let d=new Set;for(let y of l){if(y.status==="aborted")return m;y.status==="dirty"&&r.dirty(),d.add(y.value)}return{status:r.value,value:d}}let o=[...n.data.values()].map((l,d)=>a._parse(new N(n,l,n.path,d)));return n.common.async?Promise.all(o).then(l=>i(l)):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)}};pe.create=(t,e)=>new pe({valueType:t,minSize:null,maxSize:null,typeName:h.ZodSet,...v(e)});var Ne=class t extends _{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==f.function)return u(r,{code:c.invalid_type,expected:f.function,received:r.parsedType}),m;function n(o,l){return Te({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ke(),de].filter(d=>!!d),issueData:{code:c.invalid_arguments,argumentsError:l}})}function s(o,l){return Te({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ke(),de].filter(d=>!!d),issueData:{code:c.invalid_return_type,returnTypeError:l}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof W){let o=this;return w(async function(...l){let d=new T([]),y=await o._def.args.parseAsync(l,a).catch(je=>{throw d.addIssue(n(l,je)),d}),S=await Reflect.apply(i,this,y);return await o._def.returns._def.type.parseAsync(S,a).catch(je=>{throw d.addIssue(s(S,je)),d})})}else{let o=this;return w(function(...l){let d=o._def.args.safeParse(l,a);if(!d.success)throw new T([n(l,d.error)]);let y=Reflect.apply(i,this,d.data),S=o._def.returns.safeParse(y,a);if(!S.success)throw new T([s(y,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:O.create(e).rest(Z.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,n){return new t({args:e||O.create([]).rest(Z.create()),returns:r||Z.create(),typeName:h.ZodFunction,...v(n)})}},Q=class extends _{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})}};Q.create=(t,e)=>new Q({getter:t,typeName:h.ZodLazy,...v(e)});var ee=class extends _{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return u(r,{received:r.data,code:c.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}};ee.create=(t,e)=>new ee({value:t,typeName:h.ZodLiteral,...v(e)});function Ge(t,e){return new te({values:t,typeName:h.ZodEnum,...v(e)})}var te=class t extends _{constructor(){super(...arguments),me.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return u(r,{expected:b.joinValues(n),received:r.parsedType,code:c.invalid_type}),m}if(Ce(this,me,"f")||Je(this,me,new Set(this._def.values),"f"),!Ce(this,me,"f").has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return u(r,{received:r.data,code:c.invalid_enum_value,options:n}),m}return w(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(n=>!e.includes(n)),{...this._def,...r})}};me=new WeakMap;te.create=Ge;var re=class extends _{constructor(){super(...arguments),ge.set(this,void 0)}_parse(e){let r=b.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==f.string&&n.parsedType!==f.number){let s=b.objectValues(r);return u(n,{expected:b.joinValues(s),received:n.parsedType,code:c.invalid_type}),m}if(Ce(this,ge,"f")||Je(this,ge,new Set(b.getValidEnumValues(this._def.values)),"f"),!Ce(this,ge,"f").has(e.data)){let s=b.objectValues(r);return u(n,{received:n.data,code:c.invalid_enum_value,options:s}),m}return w(e.data)}get enum(){return this._def.values}};ge=new WeakMap;re.create=(t,e)=>new re({values:t,typeName:h.ZodNativeEnum,...v(e)});var W=class extends _{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==f.promise&&r.common.async===!1)return u(r,{code:c.invalid_type,expected:f.promise,received:r.parsedType}),m;let n=r.parsedType===f.promise?r.data:Promise.resolve(r.data);return w(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};W.create=(t,e)=>new W({type:t,typeName:h.ZodPromise,...v(e)});var C=class extends _{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===h.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{u(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){let i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return m;let l=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return l.status==="aborted"?m:l.status==="dirty"||r.value==="dirty"?ce(l.value):l});{if(r.value==="aborted")return m;let o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?m:o.status==="dirty"||r.value==="dirty"?ce(o.value):o}}if(s.type==="refinement"){let i=o=>{let l=s.refinement(o,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?m:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ye(i))return i;let o=s.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:n.data,path:n.path,parent:n}).then(i=>ye(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:r.value,value:o})):i);b.assertNever(s)}};C.create=(t,e,r)=>new C({schema:t,typeName:h.ZodEffects,effect:e,...v(r)});C.createWithPreprocess=(t,e,r)=>new C({schema:e,effect:{type:"preprocess",transform:t},typeName:h.ZodEffects,...v(r)});var E=class extends _{_parse(e){return this._getType(e)===f.undefined?w(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};E.create=(t,e)=>new E({innerType:t,typeName:h.ZodOptional,...v(e)});var I=class extends _{_parse(e){return this._getType(e)===f.null?w(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};I.create=(t,e)=>new I({innerType:t,typeName:h.ZodNullable,...v(e)});var ne=class extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===f.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};ne.create=(t,e)=>new ne({innerType:t,typeName:h.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});var se=class extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ve(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new T(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};se.create=(t,e)=>new se({innerType:t,typeName:h.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});var he=class extends _{_parse(e){if(this._getType(e)!==f.nan){let n=this._getOrReturnCtx(e);return u(n,{code:c.invalid_type,expected:f.nan,received:n.parsedType}),m}return{status:"valid",value:e.data}}};he.create=t=>new he({typeName:h.ZodNaN,...v(t)});var At=Symbol("zod_brand"),_e=class extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},be=class t extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?m:a.status==="dirty"?(r.dirty(),ce(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?m:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:h.ZodPipeline})}},ae=class extends _{_parse(e){let r=this._def.innerType._parse(e),n=s=>(ye(s)&&(s.value=Object.freeze(s.value)),s);return ve(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};ae.create=(t,e)=>new ae({innerType:t,typeName:h.ZodReadonly,...v(e)});function Ke(t,e={},r){return t?U.create().superRefine((n,s)=>{var a,i;if(!t(n)){let o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,l=(i=(a=o.fatal)!==null&&a!==void 0?a:r)!==null&&i!==void 0?i:!0,d=typeof o=="string"?{message:o}:o;s.addIssue({code:"custom",...d,fatal:l})}}):U.create()}var jt={object:k.lazycreate},h;(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"})(h||(h={}));var Ot=(t,e={message:`Input not instance of ${t.name}`})=>Ke(r=>r instanceof t,e),Xe=z.create,Qe=q.create,It=he.create,Rt=J.create,et=F.create,$t=H.create,Pt=ue.create,Zt=Y.create,Mt=G.create,Lt=U.create,Vt=Z.create,Dt=A.create,zt=le.create,Ut=M.create,Wt=k.create,Bt=k.strictCreate,qt=K.create,Jt=Se.create,Ft=X.create,Ht=O.create,Yt=Ee.create,Gt=fe.create,Kt=pe.create,Xt=Ne.create,Qt=Q.create,er=ee.create,tr=te.create,rr=re.create,nr=W.create,Be=C.create,sr=E.create,ar=I.create,ir=C.createWithPreprocess,or=be.create,cr=()=>Xe().optional(),dr=()=>Qe().optional(),ur=()=>et().optional(),lr={string:t=>z.create({...t,coerce:!0}),number:t=>q.create({...t,coerce:!0}),boolean:t=>F.create({...t,coerce:!0}),bigint:t=>J.create({...t,coerce:!0}),date:t=>H.create({...t,coerce:!0})},fr=m,g=Object.freeze({__proto__:null,defaultErrorMap:de,setErrorMap:ft,getErrorMap:ke,makeIssue:Te,EMPTY_PATH:pt,addIssueToContext:u,ParseStatus:x,INVALID:m,DIRTY:ce,OK:w,isAborted:$e,isDirty:Pe,isValid:ye,isAsync:ve,get util(){return b},get objectUtil(){return Re},ZodParsedType:f,getParsedType:D,ZodType:_,datetimeRegex:Ye,ZodString:z,ZodNumber:q,ZodBigInt:J,ZodBoolean:F,ZodDate:H,ZodSymbol:ue,ZodUndefined:Y,ZodNull:G,ZodAny:U,ZodUnknown:Z,ZodNever:A,ZodVoid:le,ZodArray:M,ZodObject:k,ZodUnion:K,ZodDiscriminatedUnion:Se,ZodIntersection:X,ZodTuple:O,ZodRecord:Ee,ZodMap:fe,ZodSet:pe,ZodFunction:Ne,ZodLazy:Q,ZodLiteral:ee,ZodEnum:te,ZodNativeEnum:re,ZodPromise:W,ZodEffects:C,ZodTransformer:C,ZodOptional:E,ZodNullable:I,ZodDefault:ne,ZodCatch:se,ZodNaN:he,BRAND:At,ZodBranded:_e,ZodPipeline:be,ZodReadonly:ae,custom:Ke,Schema:_,ZodSchema:_,late:jt,get ZodFirstPartyTypeKind(){return h},coerce:lr,any:Lt,array:Ut,bigint:Rt,boolean:et,date:$t,discriminatedUnion:Jt,effect:Be,enum:tr,function:Xt,instanceof:Ot,intersection:Ft,lazy:Qt,literal:er,map:Gt,nan:It,nativeEnum:rr,never:Dt,null:Mt,nullable:ar,number:Qe,object:Wt,oboolean:ur,onumber:dr,optional:sr,ostring:cr,pipeline:or,preprocess:ir,promise:nr,record:Yt,set:Kt,strictObject:Bt,string:Xe,symbol:Pt,transformer:Be,tuple:Ht,undefined:Zt,union:qt,unknown:Vt,void:zt,NEVER:fr,ZodIssueCode:c,quotelessJson:lt,ZodError:T});var pr=g.object({}),hr=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")}),mr=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.")}),gr=g.object({apps:g.string().array().default([]).describe(`Additional apps to include.
4
+
5
+ Note: additional apps need to be added as devDependencies.`),ports:mr.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.")}),yr=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.")}),vr=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.")}),xe=g.object({vite:hr.default({}).describe("Options related to Vite."),server:gr.default({}).describe("Options related to the dev server."),entries:vr.default({}).describe("Options related to the app entry points."),build:yr.default({}).describe("Options related to app build."),experimental:pr.default({}).describe("Experimental options.")}),_r=g.enum(["build","serve"]),br=g.object({command:_r,mode:g.string()}),xr=g.function().args(br).returns(xe.or(g.promise(xe))),Yr=g.function().args(g.union([xe,xr]));var wr=g.enum(["necessary","functional","analytics","marketing"]),kr=g.object({purpose:g.string().describe("Purpose of the storing the value."),category:wr.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.")}),Tr=g.record(kr.describe("Key used when writing to the storage.")),Cr=g.object({value:g.string().describe("The localization token default value."),description:g.string().describe("The localization token description.")}),Sr=g.object({localization:g.record(Cr.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.")}),Nr=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:Sr.default({}).describe("Resources used by the app."),storage:Tr.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 tt(t,e){let r=Nr.safeParse(t);return r.success?r.data:rt(r.error.format(),e?[e]:[]).join(`
6
+ `)}function rt(t,e=[],r=""){t._errors?.length&&e.push(`${r} - ${t._errors.join(" + ")}`);for(let[n,s]of Object.entries(t))n==="_errors"||!s||typeof s!="object"||Array.isArray(s)||rt(s,e,r?`${r}.${n}`:n);return e}function Me(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 Le(t,e,r=".",n){if(!Me(e))return Le(t,{},r,n);let s=Object.assign({},e);for(let a in t){if(a==="__proto__"||a==="constructor")continue;let i=t[a];i!=null&&(n&&n(s,a,i,r)||(Array.isArray(i)&&Array.isArray(s[a])?s[a]=[...i,...s[a]]:Me(i)&&Me(s[a])?s[a]=Le(i,s[a],(r?`${r}.`:"")+a.toString(),n):s[a]=i))}return s}function Ve(t){return(...e)=>e.reduce((r,n)=>Le(r,n,"",t),{})}var nt=Ve(),Qr=Ve((t,e,r)=>{if(t[e]!==void 0&&typeof r=="function")return t[e]=r(t[e]),!0}),en=Ve((t,e,r)=>{if(Array.isArray(t[e])&&typeof r=="function")return t[e]=r(t[e]),!0});var Ar=/"(?:_|\\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*:/,jr=/"(?: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*:/,Or=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Ir(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){Rr(t);return}return e}function Rr(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function De(t,e={}){if(typeof t!="string")return t;let r=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){let n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!Or.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(Ar.test(t)||jr.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,Ir)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}import{createServer as $r}from"node:net";import{networkInterfaces as Pr}from"node:os";var Zr=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 Mr(t){return Zr.has(t)}function Lr(t){return!Mr(t)}function Vr(t,e){t&&console.log(`[get-port] ${e}`)}function st(t,e){return new Promise(r=>{let n=$r();n.unref(),n.on("error",()=>{r(!1)}),n.listen({port:t,host:e},()=>{let{port:s}=n.address();n.close(()=>{r(Lr(s)&&s)})})})}function Dr(t){let e=new Set(t);for(let r of Object.values(Pr()))for(let n of r||[])n.address&&!n.internal&&!n.address.startsWith("fe80::")&&e.add(n.address);return[...e]}function zr(t){return t?`on host ${JSON.stringify(t)}`:"on any host"}async function ze(t,e=process.env.HOST,r){if(e||(e=Dr([void 0,"0.0.0.0"])),!Array.isArray(e))return st(t,e);for(let n of e){let s=await st(t,n);if(s===!1)return t<1024&&r&&Vr(r,`Unable to listen to the privileged port ${t} ${zr(n)}`),!1;t===0&&s!==0&&(t=s)}return t}import{loadConfigFromFile as Ur}from"vite";var j=R("yellow"),B=R("green"),at=R("red"),it=R("cyan"),we=R("bold"),ot=R("underline"),yn=R("italic"),vn=R("magentaBright"),ut={"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 ${j("'{{pkg}}'")} to ${B("'{{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":`${we("Gateway:")} ${ot(it("{{url}}"))}`,"info.header.changes":"Changes","info.header.recommendations":"Recommendations","info.header.warnings":"Warnings","info.next-steps":"Next steps:","info.server-url":`${we("Server:")} ${ot(it("{{url}}"))}`,"info.steps.install":`Run ${j("'{{cmd}}'")} to install the changed package versions`,"info.steps.warnings":`Address the ${at("warnings")} and ${j("recommendations")} detailed above`,"info.stop-server":we("Press CTRL + C to stop the server."),"info.upgraded":`Upgraded ${j("'{{pkg}}'")} to ${B("'{{v}}'")}`,"recommendations.update.webprovisions-registry-app":`Remove ${j("'{{pkg}}'")} and install ${B("'{{wpPkg}}'")} (preferably as a dev dependency)`,"recommendations.update.webprovisions-registry-config":`Add ${j("'@webprovisions-registry:registry=https://registry.webprovisions.io'")} to the ${B("'.npmrc'")} file to always use the Webprovisions registry for Webprovisions packages`,"recommendations.add.webprovisions-registry-config":`Create a ${B("'.npmrc'")} file containing ${j("'@webprovisions-registry:registry=https://registry.webprovisions.io'")} to always use the Webprovisions registry for Webprovisions packages`,"recommendations.upgrade":`Upgrade ${j("'{{pkg}}'")} to ${B("'{{v}}'")}`,"warnings.set":`Set ${j("'{{property}}'")} to ${B("'{{new}}'")}`,"warnings.change":`Change ${j("'{{property}}'")} from ${at("'{{current}}'")} to ${B("'{{new}}'")}`,"warnings.remove":`Remove ${j("'{{property}}'")}{{alt}}`},_n=Object.keys(ut);function ie(t,e={}){return Object.entries(e).reduce((r,[n,s])=>r.replaceAll(`{{${n}}}`,String(s)),ut[t]).trim()}var bn={type:"string",description:ie("arg.config"),required:!1,alias:"c",valueHint:"./alliance.config.ts"},xn={type:"boolean",description:ie("arg.debug"),required:!1,default:!1,alias:"d"};function wn({debug:t,input:e,output:r}){t&&($.log(we(Oe("cyan","Input:"))),console.log(JSON.stringify(e,null,2),`
7
+ `),$.log(we(Oe("cyan","Output:")))),console.log(r,`
8
+ `)}var ct=["./src/app.ts","./src/app.js","./src/app.mts","./src/app.mjs","./src/app.cts","./src/app.cjs"],Wr=["alliance.config.js","alliance.config.mjs","alliance.config.ts","alliance.config.cjs","alliance.config.mts","alliance.config.cts","alliance.config.json"];async function Br(t,e){let r;if(e?r=V(process.cwd(),e):r=Jr(),r&&L(r)){if(r.endsWith(".json"))return De(dt(r).toString());try{return(await Ur(t,r))?.config||{}}catch(n){$.error(n.message),process.exit(1)}}return{}}function qr(t){let e=V(process.cwd(),t.app);if(t.manifest=V(process.cwd(),t.manifest),!ct.includes(t.app))return t.app=e,t;for(let r of ct){let n=V(process.cwd(),r);if(L(n)){t.app=n;break}}return t}function Jr(){let t=Wr.reduce((e,r)=>{if(e.length)return e;let n=V(process.cwd(),r);return L(n)?n:e},"");if(L(t))return t}async function kn(t,e="",r={}){let n=nt(r,await Br(t,e));!n.build?.mode&&(n.build?.watch||t.command==="serve")&&(n.build={...n.build,mode:"development"});let s=xe.parse(n);return t.command==="serve"&&(await ze(s.server.ports.server)||($.error(ie("errors.port-busy",{busy:s.server.ports.server})),process.exit(1)),await ze(s.server.ports.gateway)||($.error(ie("errors.port-busy",{busy:s.server.ports.gateway})),process.exit(1))),{...s,entries:qr(s.entries)}}function Tn(t,e){let r={};if(L(e.entries.manifest)){let n=De(dt(e.entries.manifest).toString()),s=tt(n,ie("errors.invalid-manifest"));typeof s=="string"&&($.error(s),process.exit(1)),r.ALLIANCE_APP_MANIFEST=s,r.ALLIANCE_APP_NAME=JSON.stringify(s.name)}return t==="build"&&(!L(e.entries.manifest)||!L(e.entries.app))&&($.error(ie("errors.no-entry",{app:Ae(process.cwd(),V(e.entries.app)),manifest:Ae(process.cwd(),V(e.entries.manifest))})),process.exit(1)),t==="serve"&&(r.ALLIANCE_ENVIRONMENT={logging:e.server.logging}),r}function Cn({entries:t,server:e}){let r=[];L(t.app)&&L(t.manifest)&&r.push({packageName:"entry",appImportPath:t.app,manifestImportPath:t.manifest});for(let n of e.apps)r.push({packageName:n,appImportPath:`${n}/app`,manifestImportPath:`${n}/manifest`});return r.length||($.error(ie("errors.no-entry",{app:Ae(process.cwd(),V(t.app)),manifest:Ae(process.cwd(),V(t.manifest))})),process.exit(1)),r}export{De as a,j as b,B as c,at as d,it as e,we as f,ot as g,_n as h,ie as i,bn as j,xn as k,wn as l,kn as m,Tn as n,Cn as o};
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{a as n}from"./chunk-TTCH5DKE.js";import{i,l as a}from"./chunk-AEIX73UA.js";var l="@telia-ace/alliance-cli",o="1.1.3",s="CLI used when developing ACE Alliance apps.";try{await n({meta:{name:l,version:o,description:s},subCommands:{build:()=>import("./build-W6SBG5FQ.js").then(e=>e.default),serve:()=>import("./serve-7K7FAYBP.js").then(e=>e.default),jwt:()=>import("./jwt-XLHZ5OAJ.js").then(e=>e.default),"public-key":()=>import("./public-key-EGUZTSD5.js").then(e=>e.default),upgrade:()=>import("./upgrade-PZDQTBOT.js").then(e=>e.default)}})}catch(e){a.error(i("bold",i("red","Error:")),i("bold",e?.message||"something went wrong"))}
4
+ import{a as n}from"./chunk-CTYZYGF2.js";import{i,l as a}from"./chunk-2GL2UYTF.js";var l="@telia-ace/alliance-cli",o="2.0.0-dev.0",s="CLI used when developing ACE Alliance apps.";try{await n({meta:{name:l,version:o,description:s},subCommands:{build:()=>import("./build-PF7WW6A3.js").then(e=>e.default),serve:()=>import("./serve-F7KZZRPZ.js").then(e=>e.default),jwt:()=>import("./jwt-CBZJK4VQ.js").then(e=>e.default),"public-key":()=>import("./public-key-EMTOLL7G.js").then(e=>e.default),upgrade:()=>import("./upgrade-E54N2HWJ.js").then(e=>e.default)}})}catch(e){a.error(i("bold",i("red","Error:")),i("bold",e?.message||"something went wrong"))}
@@ -0,0 +1,3 @@
1
+ import { createRequire as c__createRequire } from 'node:module';
2
+ const require = c__createRequire(import.meta.url);
3
+ import{i as s,k as t,l as n}from"./chunk-KNIZSLDR.js";import"./chunk-CTYZYGF2.js";import"./chunk-2GL2UYTF.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};
@@ -1,6 +1,6 @@
1
1
  import { createRequire as c__createRequire } from 'node:module';
2
2
  const require = c__createRequire(import.meta.url);
3
- import{g as i,j as K,k as P}from"./chunk-AEIX73UA.js";import{stdin as FD,stdout as rD}from"node:process";import z from"node:readline";import{WriteStream as iD}from"node:tty";import sD from"tty";var _="\x1B",a=`${_}[`,CD="\x07",k={to(t,u){return u?`${a}${u+1};${t+1}H`:`${a}${t+1}G`},move(t,u){let e="";return t<0?e+=`${a}${-t}D`:t>0&&(e+=`${a}${t}C`),u<0?e+=`${a}${-u}A`:u>0&&(e+=`${a}${u}B`),e},up:(t=1)=>`${a}${t}A`,down:(t=1)=>`${a}${t}B`,forward:(t=1)=>`${a}${t}C`,backward:(t=1)=>`${a}${t}D`,nextLine:(t=1)=>`${a}E`.repeat(t),prevLine:(t=1)=>`${a}F`.repeat(t),left:`${a}G`,hide:`${a}?25l`,show:`${a}?25h`,save:`${_}7`,restore:`${_}8`},nD={up:(t=1)=>`${a}S`.repeat(t),down:(t=1)=>`${a}T`.repeat(t)},ED={screen:`${a}2J`,up:(t=1)=>`${a}1J`.repeat(t),down:(t=1)=>`${a}J`.repeat(t),line:`${a}2K`,lineEnd:`${a}K`,lineStart:`${a}1K`,lines(t){let u="";for(let e=0;e<t;e++)u+=this.line+(e<t-1?k.up():"");return t&&(u+=k.left),u}},A={cursor:k,scroll:nD,erase:ED,beep:CD},I={exports:{}},oD=sD,aD=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||oD.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),E=(t,u,e=t)=>F=>{let r=""+F,s=r.indexOf(u,t.length);return~s?t+Q(r,u,e,s)+u:t+r+u},Q=(t,u,e,F)=>{let r=t.substring(0,F)+e,s=t.substring(F+u.length),D=s.indexOf(u);return~D?r+Q(s,u,e,D):r+s},DD=(t=aD)=>({isColorSupported:t,reset:t?u=>`\x1B[0m${u}\x1B[0m`:String,bold:t?E("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?E("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?E("\x1B[3m","\x1B[23m"):String,underline:t?E("\x1B[4m","\x1B[24m"):String,inverse:t?E("\x1B[7m","\x1B[27m"):String,hidden:t?E("\x1B[8m","\x1B[28m"):String,strikethrough:t?E("\x1B[9m","\x1B[29m"):String,black:t?E("\x1B[30m","\x1B[39m"):String,red:t?E("\x1B[31m","\x1B[39m"):String,green:t?E("\x1B[32m","\x1B[39m"):String,yellow:t?E("\x1B[33m","\x1B[39m"):String,blue:t?E("\x1B[34m","\x1B[39m"):String,magenta:t?E("\x1B[35m","\x1B[39m"):String,cyan:t?E("\x1B[36m","\x1B[39m"):String,white:t?E("\x1B[37m","\x1B[39m"):String,gray:t?E("\x1B[90m","\x1B[39m"):String,bgBlack:t?E("\x1B[40m","\x1B[49m"):String,bgRed:t?E("\x1B[41m","\x1B[49m"):String,bgGreen:t?E("\x1B[42m","\x1B[49m"):String,bgYellow:t?E("\x1B[43m","\x1B[49m"):String,bgBlue:t?E("\x1B[44m","\x1B[49m"):String,bgMagenta:t?E("\x1B[45m","\x1B[49m"):String,bgCyan:t?E("\x1B[46m","\x1B[49m"):String,bgWhite:t?E("\x1B[47m","\x1B[49m"):String});I.exports=DD();I.exports.createColors=DD;var cD=I.exports,w=K(cD);function lD({onlyFirst:t=!1}={}){let u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(u,t?void 0:"g")}function uD(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(lD(),"")}var T={},hD={get exports(){return T},set exports(t){T=t}};(function(t){var u={};t.exports=u,u.eastAsianWidth=function(F){var r=F.charCodeAt(0),s=F.length==2?F.charCodeAt(1):0,D=r;return 55296<=r&&r<=56319&&56320<=s&&s<=57343&&(r&=1023,s&=1023,D=r<<10|s,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(F){var r=this.eastAsianWidth(F);return r=="F"||r=="W"||r=="A"?2:1};function e(F){return F.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(F){for(var r=e(F),s=0,D=0;D<r.length;D++)s=s+this.characterLength(r[D]);return s},u.slice=function(F,r,s){textLen=u.length(F),r=r||0,s=s||1,r<0&&(r=textLen+r),s<0&&(s=textLen+s);for(var D="",C=0,h=e(F),c=0;c<h.length;c++){var B=h[c],l=u.length(B);if(C>=r-(l==2?1:0))if(C+l<=s)D+=B;else break;C+=l}return D}})(hD);var BD=T,AD=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};function $(t,u={}){if(typeof t!="string"||t.length===0||(u={ambiguousIsNarrow:!0,...u},t=uD(t),t.length===0))return 0;t=t.replace(AD()," ");let e=u.ambiguousIsNarrow?1:2,F=0;for(let r of t){let s=r.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(BD.eastAsianWidth(r)){case"F":case"W":F+=2;break;case"A":F+=e;break;default:F+=1}}return F}var y=10,q=(t=0)=>u=>`\x1B[${u+t}m`,G=(t=0)=>u=>`\x1B[${38+t};5;${u}m`,H=(t=0)=>(u,e,F)=>`\x1B[${38+t};2;${u};${e};${F}m`,o={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(o.modifier);var mD=Object.keys(o.color),gD=Object.keys(o.bgColor);[...mD,...gD];function pD(){let t=new Map;for(let[u,e]of Object.entries(o)){for(let[F,r]of Object.entries(e))o[F]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},e[F]=o[F],t.set(r[0],r[1]);Object.defineProperty(o,u,{value:e,enumerable:!1})}return Object.defineProperty(o,"codes",{value:t,enumerable:!1}),o.color.close="\x1B[39m",o.bgColor.close="\x1B[49m",o.color.ansi=q(),o.color.ansi256=G(),o.color.ansi16m=H(),o.bgColor.ansi=q(y),o.bgColor.ansi256=G(y),o.bgColor.ansi16m=H(y),Object.defineProperties(o,{rgbToAnsi256:{value:(u,e,F)=>u===e&&e===F?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(F/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[F]=e;F.length===3&&(F=[...F].map(s=>s+s).join(""));let r=Number.parseInt(F,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:u=>o.rgbToAnsi256(...o.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let e,F,r;if(u>=232)e=((u-232)*10+8)/255,F=e,r=e;else{u-=16;let C=u%36;e=Math.floor(u/36)/5,F=Math.floor(C/6)/5,r=C%6/5}let s=Math.max(e,F,r)*2;if(s===0)return 30;let D=30+(Math.round(r)<<2|Math.round(F)<<1|Math.round(e));return s===2&&(D+=60),D},enumerable:!1},rgbToAnsi:{value:(u,e,F)=>o.ansi256ToAnsi(o.rgbToAnsi256(u,e,F)),enumerable:!1},hexToAnsi:{value:u=>o.ansi256ToAnsi(o.hexToAnsi256(u)),enumerable:!1}}),o}var dD=pD(),f=new Set(["\x1B","\x9B"]),$D=39,L="\x07",tD="[",bD="]",eD="m",N=`${bD}8;;`,Y=t=>`${f.values().next().value}${tD}${t}${eD}`,Z=t=>`${f.values().next().value}${N}${t}${L}`,vD=t=>t.split(" ").map(u=>$(u)),S=(t,u,e)=>{let F=[...u],r=!1,s=!1,D=$(uD(t[t.length-1]));for(let[C,h]of F.entries()){let c=$(h);if(D+c<=e?t[t.length-1]+=h:(t.push(h),D=0),f.has(h)&&(r=!0,s=F.slice(C+1).join("").startsWith(N)),r){s?h===L&&(r=!1,s=!1):h===eD&&(r=!1);continue}D+=c,D===e&&C<F.length-1&&(t.push(""),D=0)}!D&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},fD=t=>{let u=t.split(" "),e=u.length;for(;e>0&&!($(u[e-1])>0);)e--;return e===u.length?t:u.slice(0,e).join(" ")+u.slice(e).join("")},xD=(t,u,e={})=>{if(e.trim!==!1&&t.trim()==="")return"";let F="",r,s,D=vD(t),C=[""];for(let[c,B]of t.split(" ").entries()){e.trim!==!1&&(C[C.length-1]=C[C.length-1].trimStart());let l=$(C[C.length-1]);if(c!==0&&(l>=u&&(e.wordWrap===!1||e.trim===!1)&&(C.push(""),l=0),(l>0||e.trim===!1)&&(C[C.length-1]+=" ",l++)),e.hard&&D[c]>u){let g=u-l,b=1+Math.floor((D[c]-g-1)/u);Math.floor((D[c]-1)/u)<b&&C.push(""),S(C,B,u);continue}if(l+D[c]>u&&l>0&&D[c]>0){if(e.wordWrap===!1&&l<u){S(C,B,u);continue}C.push("")}if(l+D[c]>u&&e.wordWrap===!1){S(C,B,u);continue}C[C.length-1]+=B}e.trim!==!1&&(C=C.map(c=>fD(c)));let h=[...C.join(`
3
+ import{g as i,j as K,k as P}from"./chunk-2GL2UYTF.js";import{stdin as FD,stdout as rD}from"node:process";import z from"node:readline";import{WriteStream as iD}from"node:tty";import sD from"tty";var _="\x1B",a=`${_}[`,CD="\x07",k={to(t,u){return u?`${a}${u+1};${t+1}H`:`${a}${t+1}G`},move(t,u){let e="";return t<0?e+=`${a}${-t}D`:t>0&&(e+=`${a}${t}C`),u<0?e+=`${a}${-u}A`:u>0&&(e+=`${a}${u}B`),e},up:(t=1)=>`${a}${t}A`,down:(t=1)=>`${a}${t}B`,forward:(t=1)=>`${a}${t}C`,backward:(t=1)=>`${a}${t}D`,nextLine:(t=1)=>`${a}E`.repeat(t),prevLine:(t=1)=>`${a}F`.repeat(t),left:`${a}G`,hide:`${a}?25l`,show:`${a}?25h`,save:`${_}7`,restore:`${_}8`},nD={up:(t=1)=>`${a}S`.repeat(t),down:(t=1)=>`${a}T`.repeat(t)},ED={screen:`${a}2J`,up:(t=1)=>`${a}1J`.repeat(t),down:(t=1)=>`${a}J`.repeat(t),line:`${a}2K`,lineEnd:`${a}K`,lineStart:`${a}1K`,lines(t){let u="";for(let e=0;e<t;e++)u+=this.line+(e<t-1?k.up():"");return t&&(u+=k.left),u}},A={cursor:k,scroll:nD,erase:ED,beep:CD},I={exports:{}},oD=sD,aD=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||oD.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),E=(t,u,e=t)=>F=>{let r=""+F,s=r.indexOf(u,t.length);return~s?t+Q(r,u,e,s)+u:t+r+u},Q=(t,u,e,F)=>{let r=t.substring(0,F)+e,s=t.substring(F+u.length),D=s.indexOf(u);return~D?r+Q(s,u,e,D):r+s},DD=(t=aD)=>({isColorSupported:t,reset:t?u=>`\x1B[0m${u}\x1B[0m`:String,bold:t?E("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?E("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?E("\x1B[3m","\x1B[23m"):String,underline:t?E("\x1B[4m","\x1B[24m"):String,inverse:t?E("\x1B[7m","\x1B[27m"):String,hidden:t?E("\x1B[8m","\x1B[28m"):String,strikethrough:t?E("\x1B[9m","\x1B[29m"):String,black:t?E("\x1B[30m","\x1B[39m"):String,red:t?E("\x1B[31m","\x1B[39m"):String,green:t?E("\x1B[32m","\x1B[39m"):String,yellow:t?E("\x1B[33m","\x1B[39m"):String,blue:t?E("\x1B[34m","\x1B[39m"):String,magenta:t?E("\x1B[35m","\x1B[39m"):String,cyan:t?E("\x1B[36m","\x1B[39m"):String,white:t?E("\x1B[37m","\x1B[39m"):String,gray:t?E("\x1B[90m","\x1B[39m"):String,bgBlack:t?E("\x1B[40m","\x1B[49m"):String,bgRed:t?E("\x1B[41m","\x1B[49m"):String,bgGreen:t?E("\x1B[42m","\x1B[49m"):String,bgYellow:t?E("\x1B[43m","\x1B[49m"):String,bgBlue:t?E("\x1B[44m","\x1B[49m"):String,bgMagenta:t?E("\x1B[45m","\x1B[49m"):String,bgCyan:t?E("\x1B[46m","\x1B[49m"):String,bgWhite:t?E("\x1B[47m","\x1B[49m"):String});I.exports=DD();I.exports.createColors=DD;var cD=I.exports,w=K(cD);function lD({onlyFirst:t=!1}={}){let u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(u,t?void 0:"g")}function uD(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(lD(),"")}var T={},hD={get exports(){return T},set exports(t){T=t}};(function(t){var u={};t.exports=u,u.eastAsianWidth=function(F){var r=F.charCodeAt(0),s=F.length==2?F.charCodeAt(1):0,D=r;return 55296<=r&&r<=56319&&56320<=s&&s<=57343&&(r&=1023,s&=1023,D=r<<10|s,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(F){var r=this.eastAsianWidth(F);return r=="F"||r=="W"||r=="A"?2:1};function e(F){return F.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(F){for(var r=e(F),s=0,D=0;D<r.length;D++)s=s+this.characterLength(r[D]);return s},u.slice=function(F,r,s){textLen=u.length(F),r=r||0,s=s||1,r<0&&(r=textLen+r),s<0&&(s=textLen+s);for(var D="",C=0,h=e(F),c=0;c<h.length;c++){var B=h[c],l=u.length(B);if(C>=r-(l==2?1:0))if(C+l<=s)D+=B;else break;C+=l}return D}})(hD);var BD=T,AD=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};function $(t,u={}){if(typeof t!="string"||t.length===0||(u={ambiguousIsNarrow:!0,...u},t=uD(t),t.length===0))return 0;t=t.replace(AD()," ");let e=u.ambiguousIsNarrow?1:2,F=0;for(let r of t){let s=r.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(BD.eastAsianWidth(r)){case"F":case"W":F+=2;break;case"A":F+=e;break;default:F+=1}}return F}var y=10,q=(t=0)=>u=>`\x1B[${u+t}m`,G=(t=0)=>u=>`\x1B[${38+t};5;${u}m`,H=(t=0)=>(u,e,F)=>`\x1B[${38+t};2;${u};${e};${F}m`,o={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(o.modifier);var mD=Object.keys(o.color),gD=Object.keys(o.bgColor);[...mD,...gD];function pD(){let t=new Map;for(let[u,e]of Object.entries(o)){for(let[F,r]of Object.entries(e))o[F]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},e[F]=o[F],t.set(r[0],r[1]);Object.defineProperty(o,u,{value:e,enumerable:!1})}return Object.defineProperty(o,"codes",{value:t,enumerable:!1}),o.color.close="\x1B[39m",o.bgColor.close="\x1B[49m",o.color.ansi=q(),o.color.ansi256=G(),o.color.ansi16m=H(),o.bgColor.ansi=q(y),o.bgColor.ansi256=G(y),o.bgColor.ansi16m=H(y),Object.defineProperties(o,{rgbToAnsi256:{value:(u,e,F)=>u===e&&e===F?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(F/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[F]=e;F.length===3&&(F=[...F].map(s=>s+s).join(""));let r=Number.parseInt(F,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:u=>o.rgbToAnsi256(...o.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let e,F,r;if(u>=232)e=((u-232)*10+8)/255,F=e,r=e;else{u-=16;let C=u%36;e=Math.floor(u/36)/5,F=Math.floor(C/6)/5,r=C%6/5}let s=Math.max(e,F,r)*2;if(s===0)return 30;let D=30+(Math.round(r)<<2|Math.round(F)<<1|Math.round(e));return s===2&&(D+=60),D},enumerable:!1},rgbToAnsi:{value:(u,e,F)=>o.ansi256ToAnsi(o.rgbToAnsi256(u,e,F)),enumerable:!1},hexToAnsi:{value:u=>o.ansi256ToAnsi(o.hexToAnsi256(u)),enumerable:!1}}),o}var dD=pD(),f=new Set(["\x1B","\x9B"]),$D=39,L="\x07",tD="[",bD="]",eD="m",N=`${bD}8;;`,Y=t=>`${f.values().next().value}${tD}${t}${eD}`,Z=t=>`${f.values().next().value}${N}${t}${L}`,vD=t=>t.split(" ").map(u=>$(u)),S=(t,u,e)=>{let F=[...u],r=!1,s=!1,D=$(uD(t[t.length-1]));for(let[C,h]of F.entries()){let c=$(h);if(D+c<=e?t[t.length-1]+=h:(t.push(h),D=0),f.has(h)&&(r=!0,s=F.slice(C+1).join("").startsWith(N)),r){s?h===L&&(r=!1,s=!1):h===eD&&(r=!1);continue}D+=c,D===e&&C<F.length-1&&(t.push(""),D=0)}!D&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},fD=t=>{let u=t.split(" "),e=u.length;for(;e>0&&!($(u[e-1])>0);)e--;return e===u.length?t:u.slice(0,e).join(" ")+u.slice(e).join("")},xD=(t,u,e={})=>{if(e.trim!==!1&&t.trim()==="")return"";let F="",r,s,D=vD(t),C=[""];for(let[c,B]of t.split(" ").entries()){e.trim!==!1&&(C[C.length-1]=C[C.length-1].trimStart());let l=$(C[C.length-1]);if(c!==0&&(l>=u&&(e.wordWrap===!1||e.trim===!1)&&(C.push(""),l=0),(l>0||e.trim===!1)&&(C[C.length-1]+=" ",l++)),e.hard&&D[c]>u){let g=u-l,b=1+Math.floor((D[c]-g-1)/u);Math.floor((D[c]-1)/u)<b&&C.push(""),S(C,B,u);continue}if(l+D[c]>u&&l>0&&D[c]>0){if(e.wordWrap===!1&&l<u){S(C,B,u);continue}C.push("")}if(l+D[c]>u&&e.wordWrap===!1){S(C,B,u);continue}C[C.length-1]+=B}e.trim!==!1&&(C=C.map(c=>fD(c)));let h=[...C.join(`
4
4
  `)];for(let[c,B]of h.entries()){if(F+=B,f.has(B)){let{groups:g}=new RegExp(`(?:\\${tD}(?<code>\\d+)m|\\${N}(?<uri>.*)${L})`).exec(h.slice(c).join(""))||{groups:{}};if(g.code!==void 0){let b=Number.parseFloat(g.code);r=b===$D?void 0:b}else g.uri!==void 0&&(s=g.uri.length===0?void 0:g.uri)}let l=dD.codes.get(Number(r));h[c+1]===`
5
5
  `?(s&&(F+=Z("")),r&&l&&(F+=Y(l))):B===`
6
6
  `&&(r&&l&&(F+=Y(r)),s&&(F+=Z(s)))}return F};function J(t,u,e){return String(t).normalize().replace(/\r\n/g,`
@@ -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-4XHYA4LG.js";import"./chunk-TTCH5DKE.js";import"./chunk-AEIX73UA.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};
3
+ import{i as t,k as l,l as c}from"./chunk-KNIZSLDR.js";import"./chunk-CTYZYGF2.js";import"./chunk-2GL2UYTF.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-4XHYA4LG.js";import"./chunk-TTCH5DKE.js";import{l as s}from"./chunk-AEIX73UA.js";import{existsSync as d,readFileSync as h,rmSync as S}from"node: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"node: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(`
3
+ import{a as p,i as r,j as m,m as l,n as f,o as c}from"./chunk-KNIZSLDR.js";import"./chunk-CTYZYGF2.js";import{l as s}from"./chunk-2GL2UYTF.js";import{existsSync as d,readFileSync as h,rmSync as S}from"node: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"node: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};
@@ -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 _,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-4XHYA4LG.js";import"./chunk-TTCH5DKE.js";import{a as C,c as D,e as me,l as A}from"./chunk-AEIX73UA.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"node:fs";import{dirname as _e,relative as se,resolve as x,sep as M}from"node: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(`
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-KNIZSLDR.js";import"./chunk-CTYZYGF2.js";import{a as C,c as D,e as me,l as A}from"./chunk-2GL2UYTF.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"node:fs";import{dirname as _e,relative as se,resolve as x,sep as M}from"node: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
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/alliance-cli",
3
- "version": "1.1.3",
3
+ "version": "2.0.0-dev.0",
4
4
  "description": "CLI used when developing ACE Alliance apps.",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "type": "module",
@@ -14,15 +14,15 @@
14
14
  ],
15
15
  "dependencies": {
16
16
  "detect-indent": "^7.0.1",
17
- "magicast": "^0.3.2",
18
- "npm-check-updates": "^16.14.11",
17
+ "magicast": "^0.3.5",
18
+ "npm-check-updates": "^17.1.0",
19
19
  "signal-exit": "^4.1.0",
20
- "vite": "^5.0.7",
21
- "@telia-ace/alliance-gateway": "^1.1.2",
22
- "@telia-ace/alliance-internal-node-utilities": "^1.1.1"
20
+ "vite": "^5.4.2",
21
+ "@telia-ace/alliance-gateway": "^2.0.0-dev.0",
22
+ "@telia-ace/alliance-internal-node-utilities": "^2.0.0-dev.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@telia-ace/alliance-framework": "^1.1.2"
25
+ "@telia-ace/alliance-framework": "^2.0.0-dev.0"
26
26
  },
27
27
  "engines": {
28
28
  "node": ">=15.0.0"