@qlover/scripts-context 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.d.ts +86 -56
- package/dist/cjs/index.js +1 -1
- package/dist/es/index.d.ts +86 -56
- package/dist/es/index.js +1 -1
- package/package.json +4 -5
package/dist/cjs/index.d.ts
CHANGED
|
@@ -272,73 +272,105 @@ type FeReleaseConfig = {
|
|
|
272
272
|
packagesDirectories?: string[];
|
|
273
273
|
};
|
|
274
274
|
|
|
275
|
-
declare class ScriptsLogger extends Logger {
|
|
276
|
-
/**
|
|
277
|
-
* @override
|
|
278
|
-
* @param {string} value
|
|
279
|
-
* @returns {string}
|
|
280
|
-
*/
|
|
281
|
-
prefix(value: string): string;
|
|
282
|
-
obtrusive(title: string): void;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Configuration interface for Shell class
|
|
287
|
-
* @interface
|
|
288
|
-
*/
|
|
289
|
-
interface ShellConfig {
|
|
290
|
-
/** Whether to run in dry-run mode */
|
|
291
|
-
isDryRun?: boolean;
|
|
292
|
-
/** Logger instance */
|
|
293
|
-
log: Logger;
|
|
294
|
-
}
|
|
295
275
|
/**
|
|
296
276
|
* Options for shell execution
|
|
277
|
+
*
|
|
278
|
+
* This interface defines the options available for executing shell commands.
|
|
279
|
+
* It provides flexibility in controlling the behavior of shell command execution.
|
|
280
|
+
*
|
|
297
281
|
* @interface
|
|
282
|
+
* @example
|
|
283
|
+
* const options: ShellExecOptions = {
|
|
284
|
+
* silent: true,
|
|
285
|
+
* env: { PATH: '/usr/bin' },
|
|
286
|
+
* dryRun: false
|
|
287
|
+
* };
|
|
298
288
|
*/
|
|
299
289
|
interface ShellExecOptions {
|
|
300
290
|
/**
|
|
301
|
-
* Whether to suppress output to the console
|
|
291
|
+
* Whether to suppress output to the console.
|
|
292
|
+
*
|
|
293
|
+
* @type {boolean}
|
|
302
294
|
*/
|
|
303
295
|
silent?: boolean;
|
|
304
296
|
/**
|
|
305
|
-
* Environment variables to be passed to the command
|
|
297
|
+
* Environment variables to be passed to the command.
|
|
298
|
+
*
|
|
299
|
+
* @type {Record<string, string>}
|
|
306
300
|
*/
|
|
307
301
|
env?: Record<string, string>;
|
|
308
302
|
/**
|
|
309
|
-
* Result to return when in dry-run mode
|
|
303
|
+
* Result to return when in dry-run mode.
|
|
304
|
+
*
|
|
305
|
+
* @type {unknown}
|
|
310
306
|
*/
|
|
311
307
|
dryRunResult?: unknown;
|
|
312
308
|
/**
|
|
313
|
-
* Whether to perform a dry run
|
|
314
|
-
* Overrides shell config.isDryRun if set
|
|
309
|
+
* Whether to perform a dry run.
|
|
310
|
+
* Overrides shell config.isDryRun if set.
|
|
311
|
+
*
|
|
312
|
+
* @type {boolean}
|
|
315
313
|
*/
|
|
316
314
|
dryRun?: boolean;
|
|
317
315
|
/**
|
|
318
|
-
*
|
|
316
|
+
* Template context for command string interpolation.
|
|
317
|
+
*
|
|
318
|
+
* @type {Record<string, unknown>}
|
|
319
319
|
*/
|
|
320
|
-
|
|
320
|
+
context?: Record<string, unknown>;
|
|
321
321
|
/**
|
|
322
|
-
*
|
|
322
|
+
* Encoding for command output.
|
|
323
|
+
*
|
|
324
|
+
* @type {string}
|
|
323
325
|
*/
|
|
324
|
-
|
|
326
|
+
encoding?: string;
|
|
327
|
+
[key: string]: unknown;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Interface for shell execution
|
|
331
|
+
*
|
|
332
|
+
* This interface defines a method for executing shell commands.
|
|
333
|
+
* It abstracts the details of shell command execution and provides a consistent interface.
|
|
334
|
+
*
|
|
335
|
+
* @interface
|
|
336
|
+
* @example
|
|
337
|
+
* const shell: ShellInterface = {
|
|
338
|
+
* exec: async (command, options) => {
|
|
339
|
+
* // Logic to execute the command
|
|
340
|
+
* return 'Command output';
|
|
341
|
+
* }
|
|
342
|
+
* };
|
|
343
|
+
*/
|
|
344
|
+
interface ShellInterface {
|
|
345
|
+
/**
|
|
346
|
+
* Execute a command.
|
|
347
|
+
*
|
|
348
|
+
* @param {string | string[]} command - The command to execute.
|
|
349
|
+
* @param {ShellExecOptions} [options] - Options for the command execution.
|
|
350
|
+
* @returns {Promise<string>} The output of the command.
|
|
351
|
+
*/
|
|
352
|
+
exec(command: string | string[], options?: ShellExecOptions): Promise<string>;
|
|
325
353
|
}
|
|
354
|
+
|
|
355
|
+
type ExecPromiseFunction = (command: string | string[], options: ShellExecOptions) => Promise<string>;
|
|
326
356
|
/**
|
|
327
|
-
*
|
|
357
|
+
* Configuration interface for Shell class
|
|
328
358
|
* @interface
|
|
329
359
|
*/
|
|
330
|
-
interface
|
|
331
|
-
/**
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
|
|
360
|
+
interface ShellConfig extends ShellExecOptions {
|
|
361
|
+
/** Logger instance */
|
|
362
|
+
logger: Logger;
|
|
363
|
+
/**
|
|
364
|
+
* Promise for the execer
|
|
365
|
+
*/
|
|
366
|
+
execPromise?: ExecPromiseFunction;
|
|
335
367
|
}
|
|
336
368
|
/**
|
|
337
369
|
* Shell class for command execution
|
|
338
370
|
* @class
|
|
339
371
|
* @description Provides methods for executing shell commands with caching and templating support
|
|
340
372
|
*/
|
|
341
|
-
declare class Shell {
|
|
373
|
+
declare class Shell implements ShellInterface {
|
|
342
374
|
config: ShellConfig;
|
|
343
375
|
private cache;
|
|
344
376
|
/**
|
|
@@ -387,21 +419,6 @@ declare class Shell {
|
|
|
387
419
|
* @returns Promise resolving to command output
|
|
388
420
|
*/
|
|
389
421
|
execFormattedCommand(command: string | string[], options?: ShellExecOptions): Promise<string>;
|
|
390
|
-
/**
|
|
391
|
-
* Executes a string command using shelljs
|
|
392
|
-
* @param command - Command string
|
|
393
|
-
* @param options - Execution options
|
|
394
|
-
* @returns Promise resolving to command output
|
|
395
|
-
*/
|
|
396
|
-
execStringCommand(command: string, options: ShellExecOptions): Promise<string>;
|
|
397
|
-
/**
|
|
398
|
-
* Executes a command with arguments using execa
|
|
399
|
-
* @param command - Command array
|
|
400
|
-
* @param options - Execution options
|
|
401
|
-
* @param meta - Execution metadata
|
|
402
|
-
* @returns Promise resolving to command output
|
|
403
|
-
*/
|
|
404
|
-
execWithArguments(command: string[], options: ShellExecOptions, meta: ExecMeta): Promise<string>;
|
|
405
422
|
}
|
|
406
423
|
|
|
407
424
|
/**
|
|
@@ -420,6 +437,9 @@ declare class Shell {
|
|
|
420
437
|
* ```
|
|
421
438
|
*/
|
|
422
439
|
declare function getFeConfigSearch(feConfig?: Record<string, unknown>): ConfigSearch;
|
|
440
|
+
type ScriptContextOptions<T> = T & {
|
|
441
|
+
execPromise?: ExecPromiseFunction;
|
|
442
|
+
};
|
|
423
443
|
/**
|
|
424
444
|
* Options interface for FeScriptContext
|
|
425
445
|
* @interface
|
|
@@ -439,7 +459,7 @@ declare function getFeConfigSearch(feConfig?: Record<string, unknown>): ConfigSe
|
|
|
439
459
|
*/
|
|
440
460
|
interface FeScriptContextOptions<T> {
|
|
441
461
|
/** Custom logger instance */
|
|
442
|
-
logger?:
|
|
462
|
+
logger?: Logger;
|
|
443
463
|
/** Shell instance for command execution */
|
|
444
464
|
shell?: Shell;
|
|
445
465
|
/** Custom fe configuration */
|
|
@@ -449,7 +469,7 @@ interface FeScriptContextOptions<T> {
|
|
|
449
469
|
/** Enable verbose logging */
|
|
450
470
|
verbose?: boolean;
|
|
451
471
|
/** Additional script-specific options */
|
|
452
|
-
options?: T
|
|
472
|
+
options?: ScriptContextOptions<T>;
|
|
453
473
|
}
|
|
454
474
|
/**
|
|
455
475
|
* Script execution context class
|
|
@@ -470,7 +490,7 @@ interface FeScriptContextOptions<T> {
|
|
|
470
490
|
*/
|
|
471
491
|
declare class FeScriptContext<T = unknown> {
|
|
472
492
|
/** Logger instance */
|
|
473
|
-
readonly logger:
|
|
493
|
+
readonly logger: Logger;
|
|
474
494
|
/** Shell instance */
|
|
475
495
|
readonly shell: Shell;
|
|
476
496
|
/** Fe configuration */
|
|
@@ -480,7 +500,7 @@ declare class FeScriptContext<T = unknown> {
|
|
|
480
500
|
/** Verbose logging flag */
|
|
481
501
|
readonly verbose: boolean;
|
|
482
502
|
/** Script-specific options */
|
|
483
|
-
options: T
|
|
503
|
+
options: ScriptContextOptions<T>;
|
|
484
504
|
/**
|
|
485
505
|
* Creates a FeScriptContext instance
|
|
486
506
|
*
|
|
@@ -501,4 +521,14 @@ declare class FeScriptContext<T = unknown> {
|
|
|
501
521
|
constructor(scriptsOptions?: FeScriptContextOptions<T>);
|
|
502
522
|
}
|
|
503
523
|
|
|
504
|
-
|
|
524
|
+
declare class ScriptsLogger extends Logger {
|
|
525
|
+
/**
|
|
526
|
+
* @override
|
|
527
|
+
* @param {string} value
|
|
528
|
+
* @returns {string}
|
|
529
|
+
*/
|
|
530
|
+
prefix(value: string): string;
|
|
531
|
+
obtrusive(title: string): void;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
export { ConfigSearch, type ConfigSearchOptions, type ExecPromiseFunction, type FeConfig, type FeReleaseConfig, FeScriptContext, type FeScriptContextOptions, type ScriptContextOptions, ScriptsLogger, Shell, type ShellConfig, type ShellExecOptions, type ShellInterface, defaultFeConfig, getFeConfigSearch };
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r,n,t,e,o,u,i,c,a,f,s,l,p,v,h,g,b,y,d,j,m=require("cosmiconfig"),O=require("merge"),_=require("@qlover/fe-utils"),w=require("chalk"),x=require("shelljs"),P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function $(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function S(){if(n)return r;n=1;var t="object"==typeof P&&P&&P.Object===Object&&P;return r=t}function R(){if(e)return t;e=1;var r=S(),n="object"==typeof self&&self&&self.Object===Object&&self,o=r||n||Function("return this")();return t=o}function A(){if(u)return o;u=1;var r=R().Symbol;return o=r}function E(){if(c)return i;c=1;var r=A(),n=Object.prototype,t=n.hasOwnProperty,e=n.toString,o=r?r.toStringTag:void 0;return i=function(r){var n=t.call(r,o),u=r[o];try{r[o]=void 0;var i=!0}catch(r){}var c=e.call(r);return i&&(n?r[o]=u:delete r[o]),c}}function C(){if(f)return a;f=1;var r=Object.prototype.toString;return a=function(n){return r.call(n)}}function F(){if(l)return s;l=1;var r=A(),n=E(),t=C(),e=r?r.toStringTag:void 0;return s=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":e&&e in Object(r)?n(r):t(r)}}function k(){if(v)return p;return v=1,p=function(r,n){return function(t){return r(n(t))}}}function T(){if(g)return h;g=1;var r=k()(Object.getPrototypeOf,Object);return h=r}function M(){if(y)return b;return y=1,b=function(r){return null!=r&&"object"==typeof r}}function q(){if(j)return d;j=1;var r=F(),n=T(),t=M(),e=Function.prototype,o=Object.prototype,u=e.toString,i=o.hasOwnProperty,c=u.call(Object);return d=function(e){if(!t(e)||"[object Object]"!=r(e))return!1;var o=n(e);if(null===o)return!0;var a=i.call(o,"constructor")&&o.constructor;return"function"==typeof a&&a instanceof a&&u.call(a)==c}}var D=$(q());class N{name;searchPlaces;_config;loaders;searchCache;constructor(r){const{name:n,searchPlaces:t,defaultConfig:e,loaders:o}=r;if(!n&&!t)throw new Error("searchPlaces or name is required");this.name=n,this.searchPlaces=t||function(r){const n=["json","js","ts","cjs","yaml","yml"];return["package.json",...n.map((n=>`${r}.${n}`)),...n.map((n=>`.${r}.${n}`))]}(n),this._config=e||{},this.loaders=o}get config(){return O({},this._config,this.search())}getSearchPlaces(){return this.searchPlaces}get(r={}){const{file:n,dir:t=process.cwd()}=r,e={};if(!1===n)return e;const o=m.cosmiconfigSync(this.name,{searchPlaces:this.searchPlaces,loaders:this.loaders}),u=n?o.load(n):o.search(t);if(u&&"string"==typeof u.config)throw new Error(`Invalid configuration file at ${u.filepath}`);return u&&D(u.config)?u.config:e}search(){return this.searchCache?this.searchCache:this.searchCache=this.get({})}}const B={protectedBranches:["master","develop","main"],cleanFiles:["dist","node_modules","yarn.lock","package-lock.json",".eslintcache","*.log"],commitlint:{extends:["@commitlint/config-conventional"]},release:{publishPath:"",autoMergeReleasePR:!1,autoMergeType:"squash",branchName:"release-${env}-${branch}-${tagName}",PRTitle:"[${pkgName} Release] Branch:${branch}, Tag:${tagName}, Env:${env}",PRBody:"## Publish Details\n\n- 🏷️ Version: ${tagName}\n- 🌲 Branch: ${branch}\n- 🔧 Environment: ${env}\n\n## Changelog\n\n${changelog}\n\n## Notes\n\n- [ ] Please check if the version number is correct\n- [ ] Please confirm all tests have passed\n- [ ] Please confirm the documentation has been updated\n\n> This PR is auto created by release process, please contact the frontend team if there are any questions.",label:{color:"1A7F37",description:"Release PR",name:"CI-Release"},packagesDirectories:[],changePackagesLabel:"changes:${name}"},envOrder:[".env.local",".env.production",".env"]};class U extends _.Logger{prefix(r){switch(r){case"INFO":return w.blue(r);case"WARN":return w.yellow(r);case"ERROR":return w.red(r);case"DEBUG":return w.gray(r);default:return r}}obtrusive(r){const n=w.bold(r);super.obtrusive(n)}}var I,L,W,V,G,z,J,H,K,Q,X,Y,Z,rr,nr,tr,er,or,ur,ir,cr,ar,fr,sr,lr,pr,vr,hr,gr,br,yr,dr,jr,mr,Or,_r,wr,xr,Pr,$r,Sr,Rr,Ar,Er;function Cr(){if(L)return I;L=1;var r=Object.prototype;return I=function(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||r)}}function Fr(){if(V)return W;V=1;var r=k()(Object.keys,Object);return W=r}function kr(){if(z)return G;z=1;var r=Cr(),n=Fr(),t=Object.prototype.hasOwnProperty;return G=function(e){if(!r(e))return n(e);var o=[];for(var u in Object(e))t.call(e,u)&&"constructor"!=u&&o.push(u);return o}}function Tr(){if(H)return J;return H=1,J=function(r){var n=typeof r;return null!=r&&("object"==n||"function"==n)}}function Mr(){if(Q)return K;Q=1;var r=F(),n=Tr();return K=function(t){if(!n(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}}function qr(){if(Y)return X;Y=1;var r=R()["__core-js_shared__"];return X=r}function Dr(){if(rr)return Z;rr=1;var r,n=qr(),t=(r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";return Z=function(r){return!!t&&t in r}}function Nr(){if(tr)return nr;tr=1;var r=Function.prototype.toString;return nr=function(n){if(null!=n){try{return r.call(n)}catch(r){}try{return n+""}catch(r){}}return""}}function Br(){if(or)return er;or=1;var r=Mr(),n=Dr(),t=Tr(),e=Nr(),o=/^\[object .+?Constructor\]$/,u=Function.prototype,i=Object.prototype,c=u.toString,a=i.hasOwnProperty,f=RegExp("^"+c.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return er=function(u){return!(!t(u)||n(u))&&(r(u)?f:o).test(e(u))}}function Ur(){if(ir)return ur;return ir=1,ur=function(r,n){return null==r?void 0:r[n]}}function Ir(){if(ar)return cr;ar=1;var r=Br(),n=Ur();return cr=function(t,e){var o=n(t,e);return r(o)?o:void 0}}function Lr(){if(sr)return fr;sr=1;var r=Ir()(R(),"DataView");return fr=r}function Wr(){if(pr)return lr;pr=1;var r=Ir()(R(),"Map");return lr=r}function Vr(){if(hr)return vr;hr=1;var r=Ir()(R(),"Promise");return vr=r}function Gr(){if(br)return gr;br=1;var r=Ir()(R(),"Set");return gr=r}function zr(){if(dr)return yr;dr=1;var r=Ir()(R(),"WeakMap");return yr=r}function Jr(){if(mr)return jr;mr=1;var r=Lr(),n=Wr(),t=Vr(),e=Gr(),o=zr(),u=F(),i=Nr(),c="[object Map]",a="[object Promise]",f="[object Set]",s="[object WeakMap]",l="[object DataView]",p=i(r),v=i(n),h=i(t),g=i(e),b=i(o),y=u;return(r&&y(new r(new ArrayBuffer(1)))!=l||n&&y(new n)!=c||t&&y(t.resolve())!=a||e&&y(new e)!=f||o&&y(new o)!=s)&&(y=function(r){var n=u(r),t="[object Object]"==n?r.constructor:void 0,e=t?i(t):"";if(e)switch(e){case p:return l;case v:return c;case h:return a;case g:return f;case b:return s}return n}),jr=y}function Hr(){if(_r)return Or;_r=1;var r=F(),n=M();return Or=function(t){return n(t)&&"[object Arguments]"==r(t)}}function Kr(){if(xr)return wr;xr=1;var r=Hr(),n=M(),t=Object.prototype,e=t.hasOwnProperty,o=t.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(r){return n(r)&&e.call(r,"callee")&&!o.call(r,"callee")};return wr=u}function Qr(){if($r)return Pr;$r=1;var r=Array.isArray;return Pr=r}function Xr(){if(Rr)return Sr;Rr=1;return Sr=function(r){return"number"==typeof r&&r>-1&&r%1==0&&r<=9007199254740991}}function Yr(){if(Er)return Ar;Er=1;var r=Mr(),n=Xr();return Ar=function(t){return null!=t&&n(t.length)&&!r(t)}}var Zr,rn,nn,tn,en,on,un,cn={exports:{}};function an(){if(rn)return Zr;return rn=1,Zr=function(){return!1}}function fn(){return nn||(nn=1,function(r,n){var t=R(),e=an(),o=n&&!n.nodeType&&n,u=o&&r&&!r.nodeType&&r,i=u&&u.exports===o?t.Buffer:void 0,c=(i?i.isBuffer:void 0)||e;r.exports=c}(cn,cn.exports)),cn.exports}function sn(){if(en)return tn;en=1;var r=F(),n=Xr(),t=M(),e={};return e["[object Float32Array]"]=e["[object Float64Array]"]=e["[object Int8Array]"]=e["[object Int16Array]"]=e["[object Int32Array]"]=e["[object Uint8Array]"]=e["[object Uint8ClampedArray]"]=e["[object Uint16Array]"]=e["[object Uint32Array]"]=!0,e["[object Arguments]"]=e["[object Array]"]=e["[object ArrayBuffer]"]=e["[object Boolean]"]=e["[object DataView]"]=e["[object Date]"]=e["[object Error]"]=e["[object Function]"]=e["[object Map]"]=e["[object Number]"]=e["[object Object]"]=e["[object RegExp]"]=e["[object Set]"]=e["[object String]"]=e["[object WeakMap]"]=!1,tn=function(o){return t(o)&&n(o.length)&&!!e[r(o)]}}function ln(){if(un)return on;return un=1,on=function(r){return function(n){return r(n)}}}var pn,vn,hn,gn,bn,yn={exports:{}};function dn(){return pn||(pn=1,function(r,n){var t=S(),e=n&&!n.nodeType&&n,o=e&&r&&!r.nodeType&&r,u=o&&o.exports===e&&t.process,i=function(){try{var r=o&&o.require&&o.require("util").types;return r||u&&u.binding&&u.binding("util")}catch(r){}}();r.exports=i}(yn,yn.exports)),yn.exports}function jn(){if(hn)return vn;hn=1;var r=sn(),n=ln(),t=dn(),e=t&&t.isTypedArray,o=e?n(e):r;return vn=o}function mn(){if(bn)return gn;bn=1;var r=kr(),n=Jr(),t=Kr(),e=Qr(),o=Yr(),u=fn(),i=Cr(),c=jn(),a=Object.prototype.hasOwnProperty;return gn=function(f){if(null==f)return!0;if(o(f)&&(e(f)||"string"==typeof f||"function"==typeof f.splice||u(f)||c(f)||t(f)))return!f.length;var s=n(f);if("[object Map]"==s||"[object Set]"==s)return!f.size;if(i(f))return!r(f).length;for(var l in f)if(a.call(f,l))return!1;return!0}}var On,_n,wn,xn,Pn,$n,Sn,Rn,An,En,Cn,Fn,kn,Tn,Mn,qn,Dn,Nn,Bn,Un,In,Ln,Wn,Vn,Gn,zn,Jn,Hn,Kn,Qn,Xn,Yn,Zn,rt,nt,tt,et,ot,ut,it,ct,at,ft,st,lt,pt,vt,ht,gt,bt,yt,dt,jt,mt,Ot,_t,wt,xt,Pt,$t,St,Rt,At,Et,Ct,Ft,kt,Tt,Mt,qt,Dt,Nt,Bt,Ut,It,Lt,Wt,Vt,Gt,zt,Jt=$(mn());function Ht(){if(_n)return On;_n=1;var r=Ir(),n=function(){try{var n=r(Object,"defineProperty");return n({},"",{}),n}catch(r){}}();return On=n}function Kt(){if(xn)return wn;xn=1;var r=Ht();return wn=function(n,t,e){"__proto__"==t&&r?r(n,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):n[t]=e}}function Qt(){if($n)return Pn;return $n=1,Pn=function(r,n){return r===n||r!=r&&n!=n}}function Xt(){if(Rn)return Sn;Rn=1;var r=Kt(),n=Qt(),t=Object.prototype.hasOwnProperty;return Sn=function(e,o,u){var i=e[o];t.call(e,o)&&n(i,u)&&(void 0!==u||o in e)||r(e,o,u)}}function Yt(){if(En)return An;En=1;var r=Xt(),n=Kt();return An=function(t,e,o,u){var i=!o;o||(o={});for(var c=-1,a=e.length;++c<a;){var f=e[c],s=u?u(o[f],t[f],f,o,t):void 0;void 0===s&&(s=t[f]),i?n(o,f,s):r(o,f,s)}return o}}function Zt(){if(Fn)return Cn;return Fn=1,Cn=function(r){return r}}function re(){if(Tn)return kn;return Tn=1,kn=function(r,n,t){switch(t.length){case 0:return r.call(n);case 1:return r.call(n,t[0]);case 2:return r.call(n,t[0],t[1]);case 3:return r.call(n,t[0],t[1],t[2])}return r.apply(n,t)}}function ne(){if(qn)return Mn;qn=1;var r=re(),n=Math.max;return Mn=function(t,e,o){return e=n(void 0===e?t.length-1:e,0),function(){for(var u=arguments,i=-1,c=n(u.length-e,0),a=Array(c);++i<c;)a[i]=u[e+i];i=-1;for(var f=Array(e+1);++i<e;)f[i]=u[i];return f[e]=o(a),r(t,this,f)}},Mn}function te(){if(Nn)return Dn;return Nn=1,Dn=function(r){return function(){return r}}}function ee(){if(Un)return Bn;Un=1;var r=te(),n=Ht();return Bn=n?function(t,e){return n(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:Zt()}function oe(){if(Ln)return In;Ln=1;var r=Date.now;return In=function(n){var t=0,e=0;return function(){var o=r(),u=16-(o-e);if(e=o,u>0){if(++t>=800)return arguments[0]}else t=0;return n.apply(void 0,arguments)}},In}function ue(){if(Vn)return Wn;Vn=1;var r=ee(),n=oe()(r);return Wn=n}function ie(){if(zn)return Gn;zn=1;var r=Zt(),n=ne(),t=ue();return Gn=function(e,o){return t(n(e,o,r),e+"")}}function ce(){if(Hn)return Jn;Hn=1;var r=/^(?:0|[1-9]\d*)$/;return Jn=function(n,t){var e=typeof n;return!!(t=null==t?9007199254740991:t)&&("number"==e||"symbol"!=e&&r.test(n))&&n>-1&&n%1==0&&n<t}}function ae(){if(Qn)return Kn;Qn=1;var r=Qt(),n=Yr(),t=ce(),e=Tr();return Kn=function(o,u,i){if(!e(i))return!1;var c=typeof u;return!!("number"==c?n(i)&&t(u,i.length):"string"==c&&u in i)&&r(i[u],o)}}function fe(){if(Yn)return Xn;Yn=1;var r=ie(),n=ae();return Xn=function(t){return r((function(r,e){var o=-1,u=e.length,i=u>1?e[u-1]:void 0,c=u>2?e[2]:void 0;for(i=t.length>3&&"function"==typeof i?(u--,i):void 0,c&&n(e[0],e[1],c)&&(i=u<3?void 0:i,u=1),r=Object(r);++o<u;){var a=e[o];a&&t(r,a,o,i)}return r}))}}function se(){if(rt)return Zn;return rt=1,Zn=function(r,n){for(var t=-1,e=Array(r);++t<r;)e[t]=n(t);return e}}function le(){if(tt)return nt;tt=1;var r=se(),n=Kr(),t=Qr(),e=fn(),o=ce(),u=jn(),i=Object.prototype.hasOwnProperty;return nt=function(c,a){var f=t(c),s=!f&&n(c),l=!f&&!s&&e(c),p=!f&&!s&&!l&&u(c),v=f||s||l||p,h=v?r(c.length,String):[],g=h.length;for(var b in c)!a&&!i.call(c,b)||v&&("length"==b||l&&("offset"==b||"parent"==b)||p&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||o(b,g))||h.push(b);return h}}function pe(){if(ot)return et;return ot=1,et=function(r){var n=[];if(null!=r)for(var t in Object(r))n.push(t);return n}}function ve(){if(it)return ut;it=1;var r=Tr(),n=Cr(),t=pe(),e=Object.prototype.hasOwnProperty;return ut=function(o){if(!r(o))return t(o);var u=n(o),i=[];for(var c in o)("constructor"!=c||!u&&e.call(o,c))&&i.push(c);return i}}function he(){if(at)return ct;at=1;var r=le(),n=ve(),t=Yr();return ct=function(e){return t(e)?r(e,!0):n(e)}}function ge(){if(st)return ft;st=1;var r=Yt(),n=fe(),t=he(),e=n((function(n,e,o,u){r(e,t(e),n,u)}));return ft=e}function be(){if(pt)return lt;pt=1;var r=F(),n=M(),t=q();return lt=function(e){if(!n(e))return!1;var o=r(e);return"[object Error]"==o||"[object DOMException]"==o||"string"==typeof e.message&&"string"==typeof e.name&&!t(e)}}function ye(){if(ht)return vt;ht=1;var r=re(),n=ie(),t=be(),e=n((function(n,e){try{return r(n,void 0,e)}catch(r){return t(r)?r:new Error(r)}}));return vt=e}function de(){if(bt)return gt;return bt=1,gt=function(r,n){for(var t=-1,e=null==r?0:r.length,o=Array(e);++t<e;)o[t]=n(r[t],t,r);return o}}function je(){if(dt)return yt;dt=1;var r=de();return yt=function(n,t){return r(t,(function(r){return n[r]}))}}function me(){if(mt)return jt;mt=1;var r=Qt(),n=Object.prototype,t=n.hasOwnProperty;return jt=function(e,o,u,i){return void 0===e||r(e,n[u])&&!t.call(i,u)?o:e}}function Oe(){if(_t)return Ot;_t=1;var r={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};return Ot=function(n){return"\\"+r[n]}}function _e(){if(xt)return wt;xt=1;var r=le(),n=kr(),t=Yr();return wt=function(e){return t(e)?r(e):n(e)}}function we(){if($t)return Pt;$t=1;return Pt=/<%=([\s\S]+?)%>/g}function xe(){if(Rt)return St;return Rt=1,St=function(r){return function(n){return null==r?void 0:r[n]}}}function Pe(){if(Et)return At;Et=1;var r=xe()({"&":"&","<":"<",">":">",'"':""","'":"'"});return At=r}function $e(){if(Ft)return Ct;Ft=1;var r=F(),n=M();return Ct=function(t){return"symbol"==typeof t||n(t)&&"[object Symbol]"==r(t)}}function Se(){if(Tt)return kt;Tt=1;var r=A(),n=de(),t=Qr(),e=$e(),o=r?r.prototype:void 0,u=o?o.toString:void 0;return kt=function r(o){if("string"==typeof o)return o;if(t(o))return n(o,r)+"";if(e(o))return u?u.call(o):"";var i=o+"";return"0"==i&&1/o==-1/0?"-0":i},kt}function Re(){if(qt)return Mt;qt=1;var r=Se();return Mt=function(n){return null==n?"":r(n)}}function Ae(){if(Nt)return Dt;Nt=1;var r=Pe(),n=Re(),t=/[&<>"']/g,e=RegExp(t.source);return Dt=function(o){return(o=n(o))&&e.test(o)?o.replace(t,r):o}}function Ee(){if(Ut)return Bt;Ut=1;return Bt=/<%-([\s\S]+?)%>/g}function Ce(){if(Lt)return It;Lt=1;return It=/<%([\s\S]+?)%>/g}function Fe(){if(Vt)return Wt;Vt=1;var r=Ae();return Wt={escape:Ee(),evaluate:Ce(),interpolate:we(),variable:"",imports:{_:{escape:r}}}}function ke(){if(zt)return Gt;zt=1;var r=ge(),n=ye(),t=je(),e=me(),o=Oe(),u=be(),i=ae(),c=_e(),a=we(),f=Fe(),s=Re(),l=/\b__p \+= '';/g,p=/\b(__p \+=) '' \+/g,v=/(__e\(.*?\)|\b__t\)) \+\n'';/g,h=/[()=,{}\[\]\/\s]/,g=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,b=/($^)/,y=/['\n\r\u2028\u2029\\]/g,d=Object.prototype.hasOwnProperty;return Gt=function(j,m,O){var _=f.imports._.templateSettings||f;O&&i(j,m,O)&&(m=void 0),j=s(j),m=r({},m,_,e);var w,x,P=r({},m.imports,_.imports,e),$=c(P),S=t(P,$),R=0,A=m.interpolate||b,E="__p += '",C=RegExp((m.escape||b).source+"|"+A.source+"|"+(A===a?g:b).source+"|"+(m.evaluate||b).source+"|$","g"),F=d.call(m,"sourceURL")?"//# sourceURL="+(m.sourceURL+"").replace(/\s/g," ")+"\n":"";j.replace(C,(function(r,n,t,e,u,i){return t||(t=e),E+=j.slice(R,i).replace(y,o),n&&(w=!0,E+="' +\n__e("+n+") +\n'"),u&&(x=!0,E+="';\n"+u+";\n__p += '"),t&&(E+="' +\n((__t = ("+t+")) == null ? '' : __t) +\n'"),R=i+r.length,r})),E+="';\n";var k=d.call(m,"variable")&&m.variable;if(k){if(h.test(k))throw new Error("Invalid `variable` option passed into `_.template`")}else E="with (obj) {\n"+E+"\n}\n";E=(x?E.replace(l,""):E).replace(p,"$1").replace(v,"$1;"),E="function("+(k||"obj")+") {\n"+(k?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(w?", __e = _.escape":"")+(x?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+E+"return __p\n}";var T=n((function(){return Function($,F+"return "+E).apply(void 0,S)}));if(T.source=E,u(T))throw T;return T}}var Te=$(ke());class Me{config;cache;constructor(r,n=new Map){this.config=r,this.cache=n}get logger(){return this.config.log}static format(r="",n={}){return Te(r)(n)}format(r="",n={}){try{return Me.format(r,n)}catch(t){throw this.logger.error(`Unable to render template with context:\n${r}\n${JSON.stringify(n)}`),this.logger.error(t),t}}exec(r,n={}){if(Jt(r))return Promise.resolve("");const{context:t,...e}=n;return"string"==typeof r?this.execFormattedCommand(this.format(r,t||{}),e):this.execFormattedCommand(r,e)}run(r,n={}){return this.exec(r,{silent:!0,...n})}async execFormattedCommand(r,n={}){const{dryRunResult:t,silent:e,external:o,dryRun:u}=n,i=void 0!==u?u:this.config.isDryRun,c=!0===o,a="string"==typeof r?r:r.join(" "),f=!c&&this.cache.has(a);if(e||this.logger.exec(r,{isExternal:c,isCached:f}),i)return Promise.resolve(t);if(f)return this.cache.get(a);const s="string"==typeof r?this.execStringCommand(r,n):this.execWithArguments(r,n,{isExternal:c});return c||this.cache.has(a)||this.cache.set(a,s),s}execStringCommand(r,n){return new Promise(((t,e)=>{x.exec(r,{async:!0,...n},((o,u,i)=>{u=u.toString().trimEnd(),0===o?t(u):(n.silent&&this.logger.error(r),e(new Error(i||u)))}))}))}async execWithArguments(r,n,t){const[e,...o]=r;return new Promise(((r,u)=>{x.exec(`${e} ${o.join(" ")}`,{async:!0,...n},((i,c,a)=>{if(0===i){const n=c.trim();this.logger.verbose(n,{isExternal:t.isExternal}),r(n)}else n.silent&&this.logger.error(`${e} ${o.join(" ")}`),u(new Error(a||c))}))}))}}function qe(r){return new N({name:"fe-config",defaultConfig:O({},B,r)})}exports.ConfigSearch=N,exports.FeScriptContext=class{logger;shell;feConfig;dryRun;verbose;options;constructor(r){const{logger:n,shell:t,feConfig:e,dryRun:o,verbose:u,options:i}=r||{};this.logger=n||new U({debug:u,dryRun:o}),this.shell=t||new Me({log:this.logger,isDryRun:o}),this.feConfig=qe(e).config,this.dryRun=!!o,this.verbose=!!u,this.options=i||{}}},exports.ScriptsLogger=U,exports.Shell=Me,exports.defaultFeConfig=B,exports.getFeConfigSearch=qe;
|
|
1
|
+
"use strict";var r,t,n,e,o,i,u,c,a,f,s,l,p,h,v,g,y,d,b,_,m,O,j,w,R,x,k,P,S,A,E,N,T,C,$,B,z,F,I,M,U,V,D,H,G,L,W,q,Y,J,K,Q,X,Z,rr,tr,nr,er,or,ir,ur,cr,ar,fr,sr,lr,pr,hr,vr,gr,yr,dr,br,_r,mr,Or,jr,wr,Rr,xr,kr,Pr,Sr,Ar,Er,Nr,Tr,Cr,$r,Br,zr,Fr,Ir,Mr,Ur,Vr,Dr,Hr,Gr,Lr,Wr,qr,Yr,Jr,Kr,Qr,Xr,Zr,rt,tt,nt,et,ot,it,ut=require("cosmiconfig"),ct=require("child_process"),at="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ft(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function st(){if(t)return r;return t=1,r=function(r,t,n){switch(n.length){case 0:return r.call(t);case 1:return r.call(t,n[0]);case 2:return r.call(t,n[0],n[1]);case 3:return r.call(t,n[0],n[1],n[2])}return r.apply(t,n)}}function lt(){if(e)return n;return e=1,n=function(r){return r}}function pt(){if(i)return o;i=1;var r=st(),t=Math.max;return o=function(n,e,o){return e=t(void 0===e?n.length-1:e,0),function(){for(var i=arguments,u=-1,c=t(i.length-e,0),a=Array(c);++u<c;)a[u]=i[e+u];u=-1;for(var f=Array(e+1);++u<e;)f[u]=i[u];return f[e]=o(a),r(n,this,f)}},o}function ht(){if(c)return u;return c=1,u=function(r){return function(){return r}}}function vt(){if(f)return a;f=1;var r="object"==typeof at&&at&&at.Object===Object&&at;return a=r}function gt(){if(l)return s;l=1;var r=vt(),t="object"==typeof self&&self&&self.Object===Object&&self,n=r||t||Function("return this")();return s=n}function yt(){if(h)return p;h=1;var r=gt().Symbol;return p=r}function dt(){if(g)return v;g=1;var r=yt(),t=Object.prototype,n=t.hasOwnProperty,e=t.toString,o=r?r.toStringTag:void 0;return v=function(r){var t=n.call(r,o),i=r[o];try{r[o]=void 0;var u=!0}catch(r){}var c=e.call(r);return u&&(t?r[o]=i:delete r[o]),c}}function bt(){if(d)return y;d=1;var r=Object.prototype.toString;return y=function(t){return r.call(t)}}function _t(){if(_)return b;_=1;var r=yt(),t=dt(),n=bt(),e=r?r.toStringTag:void 0;return b=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":e&&e in Object(r)?t(r):n(r)}}function mt(){if(O)return m;return O=1,m=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)}}function Ot(){if(w)return j;w=1;var r=_t(),t=mt();return j=function(n){if(!t(n))return!1;var e=r(n);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}}function jt(){if(x)return R;x=1;var r=gt()["__core-js_shared__"];return R=r}function wt(){if(P)return k;P=1;var r,t=jt(),n=(r=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";return k=function(r){return!!n&&n in r}}function Rt(){if(A)return S;A=1;var r=Function.prototype.toString;return S=function(t){if(null!=t){try{return r.call(t)}catch(r){}try{return t+""}catch(r){}}return""}}function xt(){if(N)return E;N=1;var r=Ot(),t=wt(),n=mt(),e=Rt(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,u=Object.prototype,c=i.toString,a=u.hasOwnProperty,f=RegExp("^"+c.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return E=function(i){return!(!n(i)||t(i))&&(r(i)?f:o).test(e(i))}}function kt(){if(C)return T;return C=1,T=function(r,t){return null==r?void 0:r[t]}}function Pt(){if(B)return $;B=1;var r=xt(),t=kt();return $=function(n,e){var o=t(n,e);return r(o)?o:void 0}}function St(){if(F)return z;F=1;var r=Pt(),t=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(r){}}();return z=t}function At(){if(M)return I;M=1;var r=ht(),t=St();return I=t?function(n,e){return t(n,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:lt()}function Et(){if(V)return U;V=1;var r=Date.now;return U=function(t){var n=0,e=0;return function(){var o=r(),i=16-(o-e);if(e=o,i>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}},U}function Nt(){if(H)return D;H=1;var r=At(),t=Et()(r);return D=t}function Tt(){if(L)return G;L=1;var r=lt(),t=pt(),n=Nt();return G=function(e,o){return n(t(e,o,r),e+"")}}function Ct(){if(q)return W;return q=1,W=function(){this.__data__=[],this.size=0}}function $t(){if(J)return Y;return J=1,Y=function(r,t){return r===t||r!=r&&t!=t}}function Bt(){if(Q)return K;Q=1;var r=$t();return K=function(t,n){for(var e=t.length;e--;)if(r(t[e][0],n))return e;return-1}}function zt(){if(Z)return X;Z=1;var r=Bt(),t=Array.prototype.splice;return X=function(n){var e=this.__data__,o=r(e,n);return!(o<0)&&(o==e.length-1?e.pop():t.call(e,o,1),--this.size,!0)}}function Ft(){if(tr)return rr;tr=1;var r=Bt();return rr=function(t){var n=this.__data__,e=r(n,t);return e<0?void 0:n[e][1]}}function It(){if(er)return nr;er=1;var r=Bt();return nr=function(t){return r(this.__data__,t)>-1}}function Mt(){if(ir)return or;ir=1;var r=Bt();return or=function(t,n){var e=this.__data__,o=r(e,t);return o<0?(++this.size,e.push([t,n])):e[o][1]=n,this}}function Ut(){if(cr)return ur;cr=1;var r=Ct(),t=zt(),n=Ft(),e=It(),o=Mt();function i(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return i.prototype.clear=r,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=e,i.prototype.set=o,ur=i}function Vt(){if(fr)return ar;fr=1;var r=Ut();return ar=function(){this.__data__=new r,this.size=0}}function Dt(){if(lr)return sr;return lr=1,sr=function(r){var t=this.__data__,n=t.delete(r);return this.size=t.size,n}}function Ht(){if(hr)return pr;return hr=1,pr=function(r){return this.__data__.get(r)}}function Gt(){if(gr)return vr;return gr=1,vr=function(r){return this.__data__.has(r)}}function Lt(){if(dr)return yr;dr=1;var r=Pt()(gt(),"Map");return yr=r}function Wt(){if(_r)return br;_r=1;var r=Pt()(Object,"create");return br=r}function qt(){if(Or)return mr;Or=1;var r=Wt();return mr=function(){this.__data__=r?r(null):{},this.size=0}}function Yt(){if(wr)return jr;return wr=1,jr=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}}function Jt(){if(xr)return Rr;xr=1;var r=Wt(),t=Object.prototype.hasOwnProperty;return Rr=function(n){var e=this.__data__;if(r){var o=e[n];return"__lodash_hash_undefined__"===o?void 0:o}return t.call(e,n)?e[n]:void 0}}function Kt(){if(Pr)return kr;Pr=1;var r=Wt(),t=Object.prototype.hasOwnProperty;return kr=function(n){var e=this.__data__;return r?void 0!==e[n]:t.call(e,n)}}function Qt(){if(Ar)return Sr;Ar=1;var r=Wt();return Sr=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=r&&void 0===n?"__lodash_hash_undefined__":n,this}}function Xt(){if(Nr)return Er;Nr=1;var r=qt(),t=Yt(),n=Jt(),e=Kt(),o=Qt();function i(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return i.prototype.clear=r,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=e,i.prototype.set=o,Er=i}function Zt(){if(Cr)return Tr;Cr=1;var r=Xt(),t=Ut(),n=Lt();return Tr=function(){this.size=0,this.__data__={hash:new r,map:new(n||t),string:new r}}}function rn(){if(Br)return $r;return Br=1,$r=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r}}function tn(){if(Fr)return zr;Fr=1;var r=rn();return zr=function(t,n){var e=t.__data__;return r(n)?e["string"==typeof n?"string":"hash"]:e.map}}function nn(){if(Mr)return Ir;Mr=1;var r=tn();return Ir=function(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}}function en(){if(Vr)return Ur;Vr=1;var r=tn();return Ur=function(t){return r(this,t).get(t)}}function on(){if(Hr)return Dr;Hr=1;var r=tn();return Dr=function(t){return r(this,t).has(t)}}function un(){if(Lr)return Gr;Lr=1;var r=tn();return Gr=function(t,n){var e=r(this,t),o=e.size;return e.set(t,n),this.size+=e.size==o?0:1,this}}function cn(){if(qr)return Wr;qr=1;var r=Zt(),t=nn(),n=en(),e=on(),o=un();function i(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return i.prototype.clear=r,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=e,i.prototype.set=o,Wr=i}function an(){if(Jr)return Yr;Jr=1;var r=Ut(),t=Lt(),n=cn();return Yr=function(e,o){var i=this.__data__;if(i instanceof r){var u=i.__data__;if(!t||u.length<199)return u.push([e,o]),this.size=++i.size,this;i=this.__data__=new n(u)}return i.set(e,o),this.size=i.size,this}}function fn(){if(Qr)return Kr;Qr=1;var r=Ut(),t=Vt(),n=Dt(),e=Ht(),o=Gt(),i=an();function u(t){var n=this.__data__=new r(t);this.size=n.size}return u.prototype.clear=t,u.prototype.delete=n,u.prototype.get=e,u.prototype.has=o,u.prototype.set=i,Kr=u}function sn(){if(Zr)return Xr;Zr=1;var r=St();return Xr=function(t,n,e){"__proto__"==n&&r?r(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}}function ln(){if(tt)return rt;tt=1;var r=sn(),t=$t();return rt=function(n,e,o){(void 0!==o&&!t(n[e],o)||void 0===o&&!(e in n))&&r(n,e,o)}}function pn(){if(et)return nt;return et=1,nt=function(r){return function(t,n,e){for(var o=-1,i=Object(t),u=e(t),c=u.length;c--;){var a=u[r?c:++o];if(!1===n(i[a],a,i))break}return t}}}function hn(){if(it)return ot;it=1;var r=pn()();return ot=r}var vn,gn,yn,dn,bn,_n,mn,On,jn,wn,Rn,xn,kn,Pn,Sn,An,En,Nn,Tn,Cn,$n,Bn,zn,Fn,In,Mn,Un,Vn,Dn,Hn,Gn,Ln,Wn,qn={exports:{}};function Yn(){return vn||(vn=1,function(r,t){var n=gt(),e=t&&!t.nodeType&&t,o=e&&r&&!r.nodeType&&r,i=o&&o.exports===e?n.Buffer:void 0,u=i?i.allocUnsafe:void 0;r.exports=function(r,t){if(t)return r.slice();var n=r.length,e=u?u(n):new r.constructor(n);return r.copy(e),e}}(qn,qn.exports)),qn.exports}function Jn(){if(yn)return gn;yn=1;var r=gt().Uint8Array;return gn=r}function Kn(){if(bn)return dn;bn=1;var r=Jn();return dn=function(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}}function Qn(){if(mn)return _n;mn=1;var r=Kn();return _n=function(t,n){var e=n?r(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}}function Xn(){if(jn)return On;return jn=1,On=function(r,t){var n=-1,e=r.length;for(t||(t=Array(e));++n<e;)t[n]=r[n];return t}}function Zn(){if(Rn)return wn;Rn=1;var r=mt(),t=Object.create,n=function(){function n(){}return function(e){if(!r(e))return{};if(t)return t(e);n.prototype=e;var o=new n;return n.prototype=void 0,o}}();return wn=n}function re(){if(kn)return xn;return kn=1,xn=function(r,t){return function(n){return r(t(n))}}}function te(){if(Sn)return Pn;Sn=1;var r=re()(Object.getPrototypeOf,Object);return Pn=r}function ne(){if(En)return An;En=1;var r=Object.prototype;return An=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||r)}}function ee(){if(Tn)return Nn;Tn=1;var r=Zn(),t=te(),n=ne();return Nn=function(e){return"function"!=typeof e.constructor||n(e)?{}:r(t(e))}}function oe(){if($n)return Cn;return $n=1,Cn=function(r){return null!=r&&"object"==typeof r}}function ie(){if(zn)return Bn;zn=1;var r=_t(),t=oe();return Bn=function(n){return t(n)&&"[object Arguments]"==r(n)}}function ue(){if(In)return Fn;In=1;var r=ie(),t=oe(),n=Object.prototype,e=n.hasOwnProperty,o=n.propertyIsEnumerable,i=r(function(){return arguments}())?r:function(r){return t(r)&&e.call(r,"callee")&&!o.call(r,"callee")};return Fn=i}function ce(){if(Un)return Mn;Un=1;var r=Array.isArray;return Mn=r}function ae(){if(Dn)return Vn;Dn=1;return Vn=function(r){return"number"==typeof r&&r>-1&&r%1==0&&r<=9007199254740991}}function fe(){if(Gn)return Hn;Gn=1;var r=Ot(),t=ae();return Hn=function(n){return null!=n&&t(n.length)&&!r(n)}}function se(){if(Wn)return Ln;Wn=1;var r=fe(),t=oe();return Ln=function(n){return t(n)&&r(n)}}var le,pe,he,ve,ge,ye,de,be,_e,me={exports:{}};function Oe(){if(pe)return le;return pe=1,le=function(){return!1}}function je(){return he||(he=1,function(r,t){var n=gt(),e=Oe(),o=t&&!t.nodeType&&t,i=o&&r&&!r.nodeType&&r,u=i&&i.exports===o?n.Buffer:void 0,c=(u?u.isBuffer:void 0)||e;r.exports=c}(me,me.exports)),me.exports}function we(){if(ge)return ve;ge=1;var r=_t(),t=te(),n=oe(),e=Function.prototype,o=Object.prototype,i=e.toString,u=o.hasOwnProperty,c=i.call(Object);return ve=function(e){if(!n(e)||"[object Object]"!=r(e))return!1;var o=t(e);if(null===o)return!0;var a=u.call(o,"constructor")&&o.constructor;return"function"==typeof a&&a instanceof a&&i.call(a)==c},ve}function Re(){if(de)return ye;de=1;var r=_t(),t=ae(),n=oe(),e={};return e["[object Float32Array]"]=e["[object Float64Array]"]=e["[object Int8Array]"]=e["[object Int16Array]"]=e["[object Int32Array]"]=e["[object Uint8Array]"]=e["[object Uint8ClampedArray]"]=e["[object Uint16Array]"]=e["[object Uint32Array]"]=!0,e["[object Arguments]"]=e["[object Array]"]=e["[object ArrayBuffer]"]=e["[object Boolean]"]=e["[object DataView]"]=e["[object Date]"]=e["[object Error]"]=e["[object Function]"]=e["[object Map]"]=e["[object Number]"]=e["[object Object]"]=e["[object RegExp]"]=e["[object Set]"]=e["[object String]"]=e["[object WeakMap]"]=!1,ye=function(o){return n(o)&&t(o.length)&&!!e[r(o)]}}function xe(){if(_e)return be;return _e=1,be=function(r){return function(t){return r(t)}}}var ke,Pe,Se,Ae,Ee,Ne,Te,Ce,$e,Be,ze,Fe,Ie,Me,Ue,Ve,De,He,Ge,Le,We,qe,Ye,Je,Ke,Qe,Xe,Ze,ro,to,no,eo,oo,io,uo,co,ao,fo={exports:{}};function so(){return ke||(ke=1,function(r,t){var n=vt(),e=t&&!t.nodeType&&t,o=e&&r&&!r.nodeType&&r,i=o&&o.exports===e&&n.process,u=function(){try{var r=o&&o.require&&o.require("util").types;return r||i&&i.binding&&i.binding("util")}catch(r){}}();r.exports=u}(fo,fo.exports)),fo.exports}function lo(){if(Se)return Pe;Se=1;var r=Re(),t=xe(),n=so(),e=n&&n.isTypedArray,o=e?t(e):r;return Pe=o}function po(){if(Ee)return Ae;return Ee=1,Ae=function(r,t){if(("constructor"!==t||"function"!=typeof r[t])&&"__proto__"!=t)return r[t]}}function ho(){if(Te)return Ne;Te=1;var r=sn(),t=$t(),n=Object.prototype.hasOwnProperty;return Ne=function(e,o,i){var u=e[o];n.call(e,o)&&t(u,i)&&(void 0!==i||o in e)||r(e,o,i)}}function vo(){if($e)return Ce;$e=1;var r=ho(),t=sn();return Ce=function(n,e,o,i){var u=!o;o||(o={});for(var c=-1,a=e.length;++c<a;){var f=e[c],s=i?i(o[f],n[f],f,o,n):void 0;void 0===s&&(s=n[f]),u?t(o,f,s):r(o,f,s)}return o}}function go(){if(ze)return Be;return ze=1,Be=function(r,t){for(var n=-1,e=Array(r);++n<r;)e[n]=t(n);return e},Be}function yo(){if(Ie)return Fe;Ie=1;var r=/^(?:0|[1-9]\d*)$/;return Fe=function(t,n){var e=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==e||"symbol"!=e&&r.test(t))&&t>-1&&t%1==0&&t<n}}function bo(){if(Ue)return Me;Ue=1;var r=go(),t=ue(),n=ce(),e=je(),o=yo(),i=lo(),u=Object.prototype.hasOwnProperty;return Me=function(c,a){var f=n(c),s=!f&&t(c),l=!f&&!s&&e(c),p=!f&&!s&&!l&&i(c),h=f||s||l||p,v=h?r(c.length,String):[],g=v.length;for(var y in c)!a&&!u.call(c,y)||h&&("length"==y||l&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||o(y,g))||v.push(y);return v}}function _o(){if(De)return Ve;return De=1,Ve=function(r){var t=[];if(null!=r)for(var n in Object(r))t.push(n);return t}}function mo(){if(Ge)return He;Ge=1;var r=mt(),t=ne(),n=_o(),e=Object.prototype.hasOwnProperty;return He=function(o){if(!r(o))return n(o);var i=t(o),u=[];for(var c in o)("constructor"!=c||!i&&e.call(o,c))&&u.push(c);return u}}function Oo(){if(We)return Le;We=1;var r=bo(),t=mo(),n=fe();return Le=function(e){return n(e)?r(e,!0):t(e)}}function jo(){if(Ye)return qe;Ye=1;var r=vo(),t=Oo();return qe=function(n){return r(n,t(n))}}function wo(){if(Ke)return Je;Ke=1;var r=ln(),t=Yn(),n=Qn(),e=Xn(),o=ee(),i=ue(),u=ce(),c=se(),a=je(),f=Ot(),s=mt(),l=we(),p=lo(),h=po(),v=jo();return Je=function(g,y,d,b,_,m,O){var j=h(g,d),w=h(y,d),R=O.get(w);if(R)r(g,d,R);else{var x=m?m(j,w,d+"",g,y,O):void 0,k=void 0===x;if(k){var P=u(w),S=!P&&a(w),A=!P&&!S&&p(w);x=w,P||S||A?u(j)?x=j:c(j)?x=e(j):S?(k=!1,x=t(w,!0)):A?(k=!1,x=n(w,!0)):x=[]:l(w)||i(w)?(x=j,i(j)?x=v(j):s(j)&&!f(j)||(x=o(w))):k=!1}k&&(O.set(w,x),_(x,w,b,m,O),O.delete(w)),r(g,d,x)}}}function Ro(){if(Xe)return Qe;Xe=1;var r=fn(),t=ln(),n=hn(),e=wo(),o=mt(),i=Oo(),u=po();return Qe=function c(a,f,s,l,p){a!==f&&n(f,(function(n,i){if(p||(p=new r),o(n))e(a,f,i,s,c,l,p);else{var h=l?l(u(a,i),n,i+"",a,f,p):void 0;void 0===h&&(h=n),t(a,i,h)}}),i)},Qe}function xo(){if(ro)return Ze;ro=1;var r=Ro(),t=mt();return Ze=function n(e,o,i,u,c,a){return t(e)&&t(o)&&(a.set(o,e),r(e,o,void 0,n,a),a.delete(o)),e},Ze}function ko(){if(no)return to;no=1;var r=$t(),t=fe(),n=yo(),e=mt();return to=function(o,i,u){if(!e(u))return!1;var c=typeof i;return!!("number"==c?t(u)&&n(i,u.length):"string"==c&&i in u)&&r(u[i],o)}}function Po(){if(oo)return eo;oo=1;var r=Tt(),t=ko();return eo=function(n){return r((function(r,e){var o=-1,i=e.length,u=i>1?e[i-1]:void 0,c=i>2?e[2]:void 0;for(u=n.length>3&&"function"==typeof u?(i--,u):void 0,c&&t(e[0],e[1],c)&&(u=i<3?void 0:u,i=1),r=Object(r);++o<i;){var a=e[o];a&&n(r,a,o,u)}return r}))}}function So(){if(uo)return io;uo=1;var r=Ro(),t=Po()((function(t,n,e,o){r(t,n,e,o)}));return io=t}function Ao(){if(ao)return co;ao=1;var r=st(),t=Tt(),n=xo(),e=So(),o=t((function(t){return t.push(void 0,n),r(e,void 0,t)}));return co=o}var Eo=ft(Ao()),No=ft(we());class To{name;searchPlaces;_config;loaders;searchCache;constructor(r){const{name:t,searchPlaces:n,defaultConfig:e,loaders:o}=r;if(!t&&!n)throw new Error("searchPlaces or name is required");this.name=t,this.searchPlaces=n||function(r){const t=["json","js","ts","cjs","yaml","yml"];return["package.json",...t.map((t=>`${r}.${t}`)),...t.map((t=>`.${r}.${t}`))]}(t),this._config=e||{},this.loaders=o}get config(){return Eo({},this.search(),this._config)}getSearchPlaces(){return this.searchPlaces}get(r={}){const{file:t,dir:n=process.cwd()}=r,e={};if(!1===t)return e;const o=ut.cosmiconfigSync(this.name,{searchPlaces:this.searchPlaces,loaders:this.loaders}),i=t?o.load(t):o.search(n);if(i&&"string"==typeof i.config)throw new Error(`Invalid configuration file at ${i.filepath}`);return i&&No(i.config)?i.config:e}search(){return this.searchCache?this.searchCache:this.searchCache=this.get({})}}const Co={protectedBranches:["master","develop","main"],cleanFiles:["dist","node_modules","yarn.lock","package-lock.json",".eslintcache","*.log"],commitlint:{extends:["@commitlint/config-conventional"]},release:{publishPath:"",autoMergeReleasePR:!1,autoMergeType:"squash",branchName:"release-${env}-${branch}-${tagName}",PRTitle:"[${pkgName} Release] Branch:${branch}, Tag:${tagName}, Env:${env}",PRBody:"## Publish Details\n\n- 🏷️ Version: ${tagName}\n- 🌲 Branch: ${branch}\n- 🔧 Environment: ${env}\n\n## Changelog\n\n${changelog}\n\n## Notes\n\n- [ ] Please check if the version number is correct\n- [ ] Please confirm all tests have passed\n- [ ] Please confirm the documentation has been updated\n\n> This PR is auto created by release process, please contact the frontend team if there are any questions.",label:{color:"1A7F37",description:"Release PR",name:"CI-Release"},packagesDirectories:[],changePackagesLabel:"changes:${name}"},envOrder:[".env.local",".env.production",".env"]};var $o,Bo,zo,Fo,Io,Mo,Uo,Vo,Do,Ho,Go,Lo,Wo,qo,Yo,Jo,Ko,Qo,Xo,Zo,ri,ti,ni,ei,oi,ii,ui,ci,ai,fi,si,li,pi,hi,vi,gi,yi,di,bi,_i,mi,Oi;function ji(){if(Bo)return $o;Bo=1;var r=vo(),t=Po(),n=Oo(),e=t((function(t,e,o,i){r(e,n(e),t,i)}));return $o=e}function wi(){if(Fo)return zo;Fo=1;var r=_t(),t=oe(),n=we();return zo=function(e){if(!t(e))return!1;var o=r(e);return"[object Error]"==o||"[object DOMException]"==o||"string"==typeof e.message&&"string"==typeof e.name&&!n(e)}}function Ri(){if(Mo)return Io;Mo=1;var r=st(),t=Tt(),n=wi(),e=t((function(t,e){try{return r(t,void 0,e)}catch(r){return n(r)?r:new Error(r)}}));return Io=e}function xi(){if(Vo)return Uo;return Vo=1,Uo=function(r,t){for(var n=-1,e=null==r?0:r.length,o=Array(e);++n<e;)o[n]=t(r[n],n,r);return o}}function ki(){if(Ho)return Do;Ho=1;var r=xi();return Do=function(t,n){return r(n,(function(r){return t[r]}))}}function Pi(){if(Lo)return Go;Lo=1;var r=$t(),t=Object.prototype,n=t.hasOwnProperty;return Go=function(e,o,i,u){return void 0===e||r(e,t[i])&&!n.call(u,i)?o:e}}function Si(){if(qo)return Wo;qo=1;var r={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};return Wo=function(t){return"\\"+r[t]}}function Ai(){if(Jo)return Yo;Jo=1;var r=re()(Object.keys,Object);return Yo=r}function Ei(){if(Qo)return Ko;Qo=1;var r=ne(),t=Ai(),n=Object.prototype.hasOwnProperty;return Ko=function(e){if(!r(e))return t(e);var o=[];for(var i in Object(e))n.call(e,i)&&"constructor"!=i&&o.push(i);return o}}function Ni(){if(Zo)return Xo;Zo=1;var r=bo(),t=Ei(),n=fe();return Xo=function(e){return n(e)?r(e):t(e)}}function Ti(){if(ti)return ri;ti=1;return ri=/<%=([\s\S]+?)%>/g}function Ci(){if(ei)return ni;return ei=1,ni=function(r){return function(t){return null==r?void 0:r[t]}}}function $i(){if(ii)return oi;ii=1;var r=Ci()({"&":"&","<":"<",">":">",'"':""","'":"'"});return oi=r}function Bi(){if(ci)return ui;ci=1;var r=_t(),t=oe();return ui=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==r(n)}}function zi(){if(fi)return ai;fi=1;var r=yt(),t=xi(),n=ce(),e=Bi(),o=r?r.prototype:void 0,i=o?o.toString:void 0;return ai=function r(o){if("string"==typeof o)return o;if(n(o))return t(o,r)+"";if(e(o))return i?i.call(o):"";var u=o+"";return"0"==u&&1/o==-1/0?"-0":u},ai}function Fi(){if(li)return si;li=1;var r=zi();return si=function(t){return null==t?"":r(t)}}function Ii(){if(hi)return pi;hi=1;var r=$i(),t=Fi(),n=/[&<>"']/g,e=RegExp(n.source);return pi=function(o){return(o=t(o))&&e.test(o)?o.replace(n,r):o}}function Mi(){if(gi)return vi;gi=1;return vi=/<%-([\s\S]+?)%>/g}function Ui(){if(di)return yi;di=1;return yi=/<%([\s\S]+?)%>/g}function Vi(){if(_i)return bi;_i=1;var r=Ii();return bi={escape:Mi(),evaluate:Ui(),interpolate:Ti(),variable:"",imports:{_:{escape:r}}}}function Di(){if(Oi)return mi;Oi=1;var r=ji(),t=Ri(),n=ki(),e=Pi(),o=Si(),i=wi(),u=ko(),c=Ni(),a=Ti(),f=Vi(),s=Fi(),l=/\b__p \+= '';/g,p=/\b(__p \+=) '' \+/g,h=/(__e\(.*?\)|\b__t\)) \+\n'';/g,v=/[()=,{}\[\]\/\s]/,g=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,y=/($^)/,d=/['\n\r\u2028\u2029\\]/g,b=Object.prototype.hasOwnProperty;return mi=function(_,m,O){var j=f.imports._.templateSettings||f;O&&u(_,m,O)&&(m=void 0),_=s(_),m=r({},m,j,e);var w,R,x=r({},m.imports,j.imports,e),k=c(x),P=n(x,k),S=0,A=m.interpolate||y,E="__p += '",N=RegExp((m.escape||y).source+"|"+A.source+"|"+(A===a?g:y).source+"|"+(m.evaluate||y).source+"|$","g"),T=b.call(m,"sourceURL")?"//# sourceURL="+(m.sourceURL+"").replace(/\s/g," ")+"\n":"";_.replace(N,(function(r,t,n,e,i,u){return n||(n=e),E+=_.slice(S,u).replace(d,o),t&&(w=!0,E+="' +\n__e("+t+") +\n'"),i&&(R=!0,E+="';\n"+i+";\n__p += '"),n&&(E+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),S=u+r.length,r})),E+="';\n";var C=b.call(m,"variable")&&m.variable;if(C){if(v.test(C))throw new Error("Invalid `variable` option passed into `_.template`")}else E="with (obj) {\n"+E+"\n}\n";E=(R?E.replace(l,""):E).replace(p,"$1").replace(h,"$1;"),E="function("+(C||"obj")+") {\n"+(C?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(w?", __e = _.escape":"")+(R?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+E+"return __p\n}";var $=t((function(){return Function(k,T+"return "+E).apply(void 0,P)}));if($.source=E,i($))throw $;return $}}var Hi,Gi,Li=ft(Di());class Wi{config;cache;constructor(r,t=new Map){this.config=r,this.cache=t}get logger(){return this.config.logger}static format(r="",t={}){return Li(r)(t)}format(r="",t={}){try{return Wi.format(r,t)}catch(n){throw this.logger.error(`Unable to render template with context:\n${r}\n${JSON.stringify(t)}`),this.logger.error(n),n}}exec(r,t={}){const{context:n,...e}=t;return"string"==typeof r?this.execFormattedCommand(this.format(r,n||{}),e):this.execFormattedCommand(r,e)}run(r,t={}){return this.exec(r,{silent:!0,...t})}async execFormattedCommand(r,t={}){const n=this.config.execPromise;if(!n)throw new Error("execPromise is not defined");const{dryRunResult:e,silent:o,dryRun:i}=t,u=void 0!==i?i:this.config.dryRun,c="string"==typeof r?r:r.join(" "),a=this.cache.has(c);if(o||this.logger.exec(r,{isCached:a}),u)return Promise.resolve(e);if(a)return this.cache.get(c);const f=n(r,t);return this.cache.has(c)||this.cache.set(c,f),f}}function qi(){if(Gi)return Hi;Gi=1;var r=Ro(),t=Po()((function(t,n,e){r(t,n,e)}));return Hi=t}var Yi=ft(qi()),Ji=function(){function r(r){void 0===r&&(r={}),this.config=r,this.plugins=[]}return r.prototype.use=function(r){this.plugins.find((function(t){return t===r||t.pluginName===r.pluginName||t.constructor===r.constructor}))&&r.onlyOne?console.warn("Plugin ".concat(r.pluginName," is already used, skip adding")):this.plugins.push(r)},r}(),Ki=function(r,t){return Ki=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])},Ki(r,t)};function Qi(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=r}Ki(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Xi(r,t,n,e){return new(n||(n=Promise))((function(t,o){function i(r){try{c(e.next(r))}catch(r){o(r)}}function u(r){try{c(e.throw(r))}catch(r){o(r)}}function c(r){var e;r.done?t(r.value):(e=r.value,e instanceof n?e:new n((function(r){r(e)}))).then(i,u)}c((e=e.apply(r,[])).next())}))}function Zi(r,t){var n,e,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(i=0)),i;)try{if(n=1,e&&(o=2&c[0]?e.return:c[0]?e.throw||((o=e.return)&&o.call(e),0):e.next)&&!(o=o.call(e,c[1])).done)return o;switch(e=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,e=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(r,i)}catch(r){c=[6,r],e=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}function ru(r,t,n){if(2===arguments.length)for(var e,o=0,i=t.length;o<i;o++)!e&&o in t||(e||(e=Array.prototype.slice.call(t,0,o)),e[o]=t[o]);return r.concat(e||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var tu,nu,eu,ou,iu,uu=function(r){function t(t,n){var e=this.constructor,o=r.call(this,n instanceof Error?n.message:n||t)||this;return o.id=t,n instanceof Error&&"stack"in n&&(o.stack=n.stack),Object.setPrototypeOf(o,e.prototype),o}return Qi(t,r),t}(Error);!function(r){function t(){return null!==r&&r.apply(this,arguments)||this}Qi(t,r)}(uu),function(r){r.REQUEST_ERROR="REQUEST_ERROR",r.ENV_FETCH_NOT_SUPPORT="ENV_FETCH_NOT_SUPPORT",r.FETCHER_NONE="FETCHER_NONE",r.RESPONSE_NOT_OK="RESPONSE_NOT_OK",r.ABORT_ERROR="ABORT_ERROR",r.URL_NONE="URL_NONE"}(tu||(tu={})),function(r){function t(){return null!==r&&r.apply(this,arguments)||this}Qi(t,r),t.prototype.runHooks=function(r,t,n){for(var e=[],o=3;o<arguments.length;o++)e[o-3]=arguments[o];return Xi(this,0,void 0,(function(){var o,i,u,c,a,f,s,l;return Zi(this,(function(p){switch(p.label){case 0:o=-1,(u=n||{parameters:void 0,hooksRuntimes:{}}).hooksRuntimes.times=0,u.hooksRuntimes.index=void 0,c=0,a=r,p.label=1;case 1:return c<a.length?(f=a[c],o++,"function"!=typeof f[t]||"function"==typeof f.enabled&&!f.enabled(t,n)?[3,3]:(null===(l=u.hooksRuntimes)||void 0===l?void 0:l.breakChain)?[3,4]:(u.hooksRuntimes.pluginName=f.pluginName,u.hooksRuntimes.hookName=t,u.hooksRuntimes.times++,u.hooksRuntimes.index=o,[4,f[t].apply(f,ru([n],e,!1))])):[3,4];case 2:if(void 0!==(s=p.sent())&&(i=s,u.hooksRuntimes.returnValue=s,u.hooksRuntimes.returnBreakChain))return[2,i];p.label=3;case 3:return c++,[3,1];case 4:return[2,i]}}))}))},t.prototype.execNoError=function(r,t){return Xi(this,0,void 0,(function(){var n;return Zi(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.exec(r,t)];case 1:return[2,e.sent()];case 2:return(n=e.sent())instanceof uu?[2,n]:[2,new uu("UNKNOWN_ASYNC_ERROR",n)];case 3:return[2]}}))}))},t.prototype.exec=function(r,t){var n=t||r,e=t?r:void 0;if("function"!=typeof n)throw new Error("Task must be a async function!");return this.run(e,n)},t.prototype.run=function(r,t){return Xi(this,0,void 0,(function(){var n,e,o,i=this;return Zi(this,(function(u){switch(u.label){case 0:n={parameters:r,returnValue:void 0,error:void 0,hooksRuntimes:{pluginName:"",hookName:"",returnValue:void 0,returnBreakChain:!1,times:0}},e=function(r){return Xi(i,0,void 0,(function(){var n;return Zi(this,(function(e){switch(e.label){case 0:return[4,this.runHooks(this.plugins,"onExec",r,t)];case 1:return e.sent(),0!==r.hooksRuntimes.times?[3,3]:(n=r,[4,t(r)]);case 2:return n.returnValue=e.sent(),[2];case 3:return r.returnValue=r.hooksRuntimes.returnValue,[2]}}))}))},u.label=1;case 1:return u.trys.push([1,5,7,8]),[4,this.runHooks(this.plugins,"onBefore",n)];case 2:return u.sent(),[4,e(n)];case 3:return u.sent(),[4,this.runHooks(this.plugins,"onSuccess",n)];case 4:return u.sent(),[2,n.returnValue];case 5:return o=u.sent(),n.error=o,Object.assign(n.hooksRuntimes,{returnBreakChain:!0}),[4,this.runHooks(this.plugins,"onError",n)];case 6:if(u.sent(),n.hooksRuntimes.returnValue&&(n.error=n.hooksRuntimes.returnValue),n.error instanceof uu)throw n.error;throw new uu("UNKNOWN_ASYNC_ERROR",n.error);case 7:return n.hooksRuntimes={pluginName:"",hookName:"",returnValue:void 0,returnBreakChain:!1,times:0},[7];case 8:return[2]}}))}))}}(Ji),function(r){function t(){return null!==r&&r.apply(this,arguments)||this}Qi(t,r),t.prototype.runHooks=function(r,t,n){for(var e,o=[],i=3;i<arguments.length;i++)o[i-3]=arguments[i];var u,c=-1,a=n||{parameters:void 0,hooksRuntimes:{}};a.hooksRuntimes.times=0,a.hooksRuntimes.index=void 0;for(var f=0,s=r;f<s.length;f++){var l=s[f];if(c++,"function"==typeof l[t]&&("function"!=typeof l.enabled||l.enabled(t,a))){if(null===(e=a.hooksRuntimes)||void 0===e?void 0:e.breakChain)break;a.hooksRuntimes.pluginName=l.pluginName,a.hooksRuntimes.hookName=t,a.hooksRuntimes.times++,a.hooksRuntimes.index=c;var p=l[t].apply(l,ru([n],o,!1));if(void 0!==p&&(u=p,a.hooksRuntimes.returnValue=p,a.hooksRuntimes.returnBreakChain))return u}}return u},t.prototype.execNoError=function(r,t){try{return this.exec(r,t)}catch(r){return r instanceof uu?r:new uu("UNKNOWN_SYNC_ERROR",r)}},t.prototype.exec=function(r,t){var n=t||r,e=t?r:void 0;if("function"!=typeof n)throw new Error("Task must be a function!");return this.run(e,n)},t.prototype.run=function(r,t){var n,e={parameters:r,returnValue:void 0,error:void 0,hooksRuntimes:{pluginName:"",hookName:"",returnValue:void 0,returnBreakChain:!1,times:0}};try{return this.runHooks(this.plugins,"onBefore",e),n=e,this.runHooks(this.plugins,"onExec",n,t),n.returnValue=n.hooksRuntimes.times?n.hooksRuntimes.returnValue:t(n),this.runHooks(this.plugins,"onSuccess",e),e.returnValue}catch(r){if(e.error=r,Object.assign(e.hooksRuntimes,{returnBreakChain:!0}),this.runHooks(this.plugins,"onError",e),e.hooksRuntimes.returnValue&&(e.error=e.hooksRuntimes.returnValue),e.error instanceof uu)throw e.error;throw new uu("UNKNOWN_SYNC_ERROR",e.error)}finally{e.hooksRuntimes={pluginName:"",hookName:"",returnValue:void 0,returnBreakChain:!1,times:0}}}}(Ji);var cu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function au(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var fu,su,lu,pu,hu,vu,gu,yu,du,bu,_u,mu,Ou,ju,wu,Ru,xu,ku,Pu,Su,Au,Eu,Nu=au(iu?ou:(iu=1,ou=eu?nu:(eu=1,nu=function(r){return r&&r.length?r[0]:void 0}))),Tu=au(su?fu:(su=1,fu=function(r){var t=null==r?0:r.length;return t?r[t-1]:void 0}));function Cu(){if(vu)return hu;vu=1;var r=function(){if(pu)return lu;pu=1;var r="object"==typeof cu&&cu&&cu.Object===Object&&cu;return lu=r}(),t="object"==typeof self&&self&&self.Object===Object&&self,n=r||t||Function("return this")();return hu=n}function $u(){if(yu)return gu;yu=1;var r=Cu().Symbol;return gu=r}function Bu(){if(ju)return Ou;ju=1;var r=$u(),t=function(){if(bu)return du;bu=1;var r=$u(),t=Object.prototype,n=t.hasOwnProperty,e=t.toString,o=r?r.toStringTag:void 0;return du=function(r){var t=n.call(r,o),i=r[o];try{r[o]=void 0;var u=!0}catch(r){}var c=e.call(r);return u&&(t?r[o]=i:delete r[o]),c}}(),n=function(){if(mu)return _u;mu=1;var r=Object.prototype.toString;return _u=function(t){return r.call(t)}}(),e=r?r.toStringTag:void 0;return Ou=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":e&&e in Object(r)?t(r):n(r)}}function zu(){return Su?Pu:(Su=1,Pu=function(r){return null!=r&&"object"==typeof r})}var Fu,Iu,Mu,Uu,Vu=au(function(){if(Eu)return Au;Eu=1;var r=Bu(),t=function(){if(ku)return xu;ku=1;var r=(Ru?wu:(Ru=1,wu=function(r,t){return function(n){return r(t(n))}}))(Object.getPrototypeOf,Object);return xu=r}(),n=zu(),e=Function.prototype,o=Object.prototype,i=e.toString,u=o.hasOwnProperty,c=i.call(Object);return Au=function(e){if(!n(e)||"[object Object]"!=r(e))return!1;var o=t(e);if(null===o)return!0;var a=u.call(o,"constructor")&&o.constructor;return"function"==typeof a&&a instanceof a&&i.call(a)==c}}());function Du(){if(Iu)return Fu;Iu=1;var r=Array.isArray;return Fu=r}var Hu,Gu,Lu=function(){if(Uu)return Mu;Uu=1;var r=Bu(),t=Du(),n=zu();return Mu=function(e){return"string"==typeof e||!t(e)&&n(e)&&"[object String]"==r(e)}}(),Wu=au(Lu),qu=au(Du());function Yu(){return Gu?Hu:(Gu=1,Hu=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)})}var Ju,Ku,Qu,Xu,Zu,rc,tc,nc,ec,oc,ic,uc,cc,ac,fc,sc,lc,pc,hc,vc,gc,yc,dc,bc,_c,mc,Oc,jc,wc,Rc,xc,kc,Pc,Sc,Ac,Ec,Nc,Tc,Cc,$c,Bc,zc,Fc,Ic,Mc,Uc,Vc,Dc,Hc,Gc,Lc,Wc,qc,Yc,Jc,Kc,Qc,Xc,Zc,ra,ta,na,ea,oa,ia,ua,ca,aa,fa,sa,la,pa,ha,va,ga,ya,da,ba,_a,ma,Oa,ja,wa,Ra,xa,ka,Pa,Sa,Aa,Ea,Na,Ta,Ca,$a,Ba,za,Fa,Ia,Ma,Ua,Va,Da,Ha,Ga,La,Wa,qa,Ya,Ja,Ka,Qa,Xa,Za,rf,tf,nf,ef,of,uf,cf,af,ff,sf,lf,pf,hf,vf,gf,yf,df,bf,_f,mf,Of,jf,wf,Rf,xf=au(Yu()),kf="LOG",Pf="INFO",Sf="ERROR",Af="WARN",Ef="DEBUG",Nf=function(){function r(r){var t=void 0===r?{}:r,n=t.isCI,e=void 0!==n&&n,o=t.dryRun,i=void 0!==o&&o,u=t.debug,c=void 0!==u&&u,a=t.silent,f=void 0!==a&&a;this.isCI=e,this.isDryRun=i,this.isDebug=c,this.isSilent=f}return r.prototype.print=function(r){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.isSilent||console.log.apply(console,t)},r.prototype.prefix=function(r,t){return r},r.prototype.log=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this.print.apply(this,ru([kf],r,!1))},r.prototype.info=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this.print.apply(this,ru([Pf,this.prefix(Pf)],r,!1))},r.prototype.warn=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this.print.apply(this,ru([Af,this.prefix(Af)],r,!1))},r.prototype.error=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this.print.apply(this,ru([Sf,this.prefix(Sf)],r,!1))},r.prototype.debug=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];if(this.isDebug){var n=Nu(r),e=xf(n)?JSON.stringify(n):String(n);this.print.apply(this,ru([Ef,this.prefix(Ef),e],r.slice(1),!1))}},r.prototype.verbose=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this.isDebug&&this.print.apply(this,ru([Ef],r,!1))},r.prototype.exec=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=Vu(Tu(r))?Tu(r):void 0,e=n||{},o=e.isDryRun,i=e.isExternal;if(o||this.isDryRun){var u=[null==i?"$":"!",r.slice(0,null==n?void 0:-1).map((function(r){return Wu(r)?r:qu(r)?r.join(" "):String(r)})).join(" ")].join(" ").trim();this.log(u)}},r.prototype.obtrusive=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this.isCI||this.log(),this.log.apply(this,r),this.isCI||this.log()},r}(),Tf={exports:{}},Cf=(Ju||(Ju=1,function(r,t){function n(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return e.apply(void 0,r)}function e(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return a(!0===r[0],!1,r)}function o(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return a(!0===r[0],!0,r)}function i(r){if(Array.isArray(r)){for(var t=[],n=0;n<r.length;++n)t.push(i(r[n]));return t}if(u(r)){for(var n in t={},r)t[n]=i(r[n]);return t}return r}function u(r){return r&&"object"==typeof r&&!Array.isArray(r)}function c(r,t){if(!u(r))return t;for(var n in t)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&(r[n]=u(r[n])&&u(t[n])?c(r[n],t[n]):t[n]);return r}function a(r,t,n){var e;!r&&u(e=n.shift())||(e={});for(var o=0;o<n.length;++o){var a=n[o];if(u(a))for(var f in a)if("__proto__"!==f&&"constructor"!==f&&"prototype"!==f){var s=r?i(a[f]):a[f];e[f]=t?c(e[f],s):s}}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.isPlainObject=t.clone=t.recursive=t.merge=t.main=void 0,r.exports=t=n,t.default=n,t.main=n,n.clone=i,n.isPlainObject=u,n.recursive=o,t.merge=e,t.recursive=o,t.clone=i,t.isPlainObject=u}(Tf,Tf.exports)),Tf.exports);function $f(){if(Qu)return Ku;Qu=1;var r=Bu(),t=zu();return Ku=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==r(n)}}function Bf(){if(fc)return ac;fc=1;var r=function(){if(tc)return rc;tc=1;var r=Bu(),t=Yu();return rc=function(n){if(!t(n))return!1;var e=r(n);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}}(),t=function(){if(ic)return oc;ic=1;var r,t=function(){if(ec)return nc;ec=1;var r=Cu()["__core-js_shared__"];return nc=r}(),n=(r=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";return oc=function(r){return!!n&&n in r}}(),n=Yu(),e=function(){if(cc)return uc;cc=1;var r=Function.prototype.toString;return uc=function(t){if(null!=t){try{return r.call(t)}catch(r){}try{return t+""}catch(r){}}return""}}(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,u=Object.prototype,c=i.toString,a=u.hasOwnProperty,f=RegExp("^"+c.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return ac=function(i){return!(!n(i)||t(i))&&(r(i)?f:o).test(e(i))}}function zf(){if(hc)return pc;hc=1;var r=Bf(),t=lc?sc:(lc=1,sc=function(r,t){return null==r?void 0:r[t]});return pc=function(n,e){var o=t(n,e);return r(o)?o:void 0}}function Ff(){if(gc)return vc;gc=1;var r=zf()(Object,"create");return vc=r}function If(){return Nc?Ec:(Nc=1,Ec=function(r,t){return r===t||r!=r&&t!=t})}function Mf(){if(Cc)return Tc;Cc=1;var r=If();return Tc=function(t,n){for(var e=t.length;e--;)if(r(t[e][0],n))return e;return-1}}function Uf(){if(qc)return Wc;qc=1;var r=function(){if(Pc)return kc;Pc=1;var r=function(){if(dc)return yc;dc=1;var r=Ff();return yc=function(){this.__data__=r?r(null):{},this.size=0}}(),t=_c?bc:(_c=1,bc=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}),n=function(){if(Oc)return mc;Oc=1;var r=Ff(),t=Object.prototype.hasOwnProperty;return mc=function(n){var e=this.__data__;if(r){var o=e[n];return"__lodash_hash_undefined__"===o?void 0:o}return t.call(e,n)?e[n]:void 0}}(),e=function(){if(wc)return jc;wc=1;var r=Ff(),t=Object.prototype.hasOwnProperty;return jc=function(n){var e=this.__data__;return r?void 0!==e[n]:t.call(e,n)}}(),o=function(){if(xc)return Rc;xc=1;var r=Ff();return Rc=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=r&&void 0===n?"__lodash_hash_undefined__":n,this}}();function i(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return i.prototype.clear=r,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=e,i.prototype.set=o,kc=i}(),t=function(){if(Hc)return Dc;Hc=1;var r=Ac?Sc:(Ac=1,Sc=function(){this.__data__=[],this.size=0}),t=function(){if(Bc)return $c;Bc=1;var r=Mf(),t=Array.prototype.splice;return $c=function(n){var e=this.__data__,o=r(e,n);return!(o<0||(o==e.length-1?e.pop():t.call(e,o,1),--this.size,0))}}(),n=function(){if(Fc)return zc;Fc=1;var r=Mf();return zc=function(t){var n=this.__data__,e=r(n,t);return e<0?void 0:n[e][1]}}(),e=function(){if(Mc)return Ic;Mc=1;var r=Mf();return Ic=function(t){return r(this.__data__,t)>-1}}(),o=function(){if(Vc)return Uc;Vc=1;var r=Mf();return Uc=function(t,n){var e=this.__data__,o=r(e,t);return o<0?(++this.size,e.push([t,n])):e[o][1]=n,this}}();function i(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return i.prototype.clear=r,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=e,i.prototype.set=o,Dc=i}(),n=function(){if(Lc)return Gc;Lc=1;var r=zf()(Cu(),"Map");return Gc=r}();return Wc=function(){this.size=0,this.__data__={hash:new r,map:new(n||t),string:new r}}}function Vf(){if(Qc)return Kc;Qc=1;var r=Jc?Yc:(Jc=1,Yc=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r});return Kc=function(t,n){var e=t.__data__;return r(n)?e["string"==typeof n?"string":"hash"]:e.map}}function Df(){if(la)return sa;la=1;var r=function(){if(fa)return aa;fa=1;var r=function(){if(ca)return ua;ca=1;var r=Uf(),t=function(){if(Zc)return Xc;Zc=1;var r=Vf();return Xc=function(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}}(),n=function(){if(ta)return ra;ta=1;var r=Vf();return ra=function(t){return r(this,t).get(t)}}(),e=function(){if(ea)return na;ea=1;var r=Vf();return na=function(t){return r(this,t).has(t)}}(),o=function(){if(ia)return oa;ia=1;var r=Vf();return oa=function(t,n){var e=r(this,t),o=e.size;return e.set(t,n),this.size+=e.size==o?0:1,this}}();function i(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return i.prototype.clear=r,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=e,i.prototype.set=o,ua=i}();function t(n,e){if("function"!=typeof n||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var o=function(){var r=arguments,t=e?e.apply(this,r):r[0],i=o.cache;if(i.has(t))return i.get(t);var u=n.apply(this,r);return o.cache=i.set(t,u)||i,u};return o.cache=new(t.Cache||r),o}return t.Cache=r,aa=t}();return sa=function(t){var n=r(t,(function(r){return 500===e.size&&e.clear(),r})),e=n.cache;return n}}function Hf(){if(Oa)return ma;Oa=1;var r=Du(),t=function(){if(Zu)return Xu;Zu=1;var r=Du(),t=$f(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,e=/^\w*$/;return Xu=function(o,i){if(r(o))return!1;var u=typeof o;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=o&&!t(o))||e.test(o)||!n.test(o)||null!=i&&o in Object(i)}}(),n=function(){if(ha)return pa;ha=1;var r=Df(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,e=r((function(r){var e=[];return 46===r.charCodeAt(0)&&e.push(""),r.replace(t,(function(r,t,o,i){e.push(o?i.replace(n,"$1"):t||r)})),e}));return pa=e}(),e=function(){if(_a)return ba;_a=1;var r=function(){if(da)return ya;da=1;var r=$u(),t=ga?va:(ga=1,va=function(r,t){for(var n=-1,e=null==r?0:r.length,o=Array(e);++n<e;)o[n]=t(r[n],n,r);return o}),n=Du(),e=$f(),o=r?r.prototype:void 0,i=o?o.toString:void 0;return ya=function r(o){if("string"==typeof o)return o;if(n(o))return t(o,r)+"";if(e(o))return i?i.call(o):"";var u=o+"";return"0"==u&&1/o==-1/0?"-0":u},ya}();return ba=function(t){return null==t?"":r(t)}}();return ma=function(o,i){return r(o)?o:t(o,i)?[o]:n(e(o))}}function Gf(){if(wa)return ja;wa=1;var r=$f();return ja=function(t){if("string"==typeof t||r(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}}function Lf(){if(Pa)return ka;Pa=1;var r=zf(),t=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(r){}}();return ka=t}function Wf(){if(Ca)return Ta;Ca=1;var r=/^(?:0|[1-9]\d*)$/;return Ta=function(t,n){var e=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==e||"symbol"!=e&&r.test(t))&&t>-1&&t%1==0&&t<n}}function qf(){if(Fa)return za;Fa=1;var r=function(){if(xa)return Ra;xa=1;var r=Hf(),t=Gf();return Ra=function(n,e){for(var o=0,i=(e=r(e,n)).length;null!=n&&o<i;)n=n[t(e[o++])];return o&&o==i?n:void 0}}(),t=function(){if(Ba)return $a;Ba=1;var r=function(){if(Na)return Ea;Na=1;var r=function(){if(Aa)return Sa;Aa=1;var r=Lf();return Sa=function(t,n,e){"__proto__"==n&&r?r(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}}(),t=If(),n=Object.prototype.hasOwnProperty;return Ea=function(e,o,i){var u=e[o];n.call(e,o)&&t(u,i)&&(void 0!==i||o in e)||r(e,o,i)}}(),t=Hf(),n=Wf(),e=Yu(),o=Gf();return $a=function(i,u,c,a){if(!e(i))return i;for(var f=-1,s=(u=t(u,i)).length,l=s-1,p=i;null!=p&&++f<s;){var h=o(u[f]),v=c;if("__proto__"===h||"constructor"===h||"prototype"===h)return i;if(f!=l){var g=p[h];void 0===(v=a?a(g,h,p):void 0)&&(v=e(g)?g:n(u[f+1])?[]:{})}r(p,h,v),p=p[h]}return i}}(),n=Hf();return za=function(e,o,i){for(var u=-1,c=o.length,a={};++u<c;){var f=o[u],s=r(e,f);i(s,f)&&t(a,n(f,e),s)}return a}}function Yf(){if(Ha)return Da;Ha=1;var r=function(){if(Va)return Ua;Va=1;var r=Bu(),t=zu();return Ua=function(n){return t(n)&&"[object Arguments]"==r(n)}}(),t=zu(),n=Object.prototype,e=n.hasOwnProperty,o=n.propertyIsEnumerable,i=r(function(){return arguments}())?r:function(r){return t(r)&&e.call(r,"callee")&&!o.call(r,"callee")};return Da=i}function Jf(){if(Ja)return Ya;Ja=1;var r=Ma?Ia:(Ma=1,Ia=function(r,t){return null!=r&&t in Object(r)}),t=function(){if(qa)return Wa;qa=1;var r=Hf(),t=Yf(),n=Du(),e=Wf(),o=La?Ga:(La=1,Ga=function(r){return"number"==typeof r&&r>-1&&r%1==0&&r<=9007199254740991}),i=Gf();return Wa=function(u,c,a){for(var f=-1,s=(c=r(c,u)).length,l=!1;++f<s;){var p=i(c[f]);if(!(l=null!=u&&a(u,p)))break;u=u[p]}return l||++f!=s?l:!!(s=null==u?0:u.length)&&o(s)&&e(p,s)&&(n(u)||t(u))}}();return Ya=function(n,e){return null!=n&&t(n,e,r)}}function Kf(){if(mf)return _f;mf=1;var r=function(){if(yf)return gf;yf=1;var r=pf?lf:(pf=1,lf=function(r){return function(){return r}}),t=Lf(),n=vf?hf:(vf=1,hf=function(r){return r});return gf=t?function(n,e){return t(n,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:n}(),t=function(){if(bf)return df;bf=1;var r=Date.now;return df=function(t){var n=0,e=0;return function(){var o=r(),i=16-(o-e);if(e=o,i>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}},df}(),n=t(r);return _f=n}function Qf(){if(jf)return Of;jf=1;var r=function(){if(uf)return of;uf=1;var r=function(){if(ef)return nf;ef=1;var r=Za?Xa:(Za=1,Xa=function(r,t){for(var n=-1,e=t.length,o=r.length;++n<e;)r[o+n]=t[n];return r}),t=function(){if(tf)return rf;tf=1;var r=$u(),t=Yf(),n=Du(),e=r?r.isConcatSpreadable:void 0;return rf=function(r){return n(r)||t(r)||!!(e&&r&&r[e])}}();return nf=function n(e,o,i,u,c){var a=-1,f=e.length;for(i||(i=t),c||(c=[]);++a<f;){var s=e[a];o>0&&i(s)?o>1?n(s,o-1,i,u,c):r(c,s):u||(c[c.length]=s)}return c},nf}();return of=function(t){return null!=t&&t.length?r(t,1):[]}}(),t=function(){if(sf)return ff;sf=1;var r=af?cf:(af=1,cf=function(r,t,n){switch(n.length){case 0:return r.call(t);case 1:return r.call(t,n[0]);case 2:return r.call(t,n[0],n[1]);case 3:return r.call(t,n[0],n[1],n[2])}return r.apply(t,n)}),t=Math.max;return ff=function(n,e,o){return e=t(void 0===e?n.length-1:e,0),function(){for(var i=arguments,u=-1,c=t(i.length-e,0),a=Array(c);++u<c;)a[u]=i[e+u];u=-1;for(var f=Array(e+1);++u<e;)f[u]=i[u];return f[e]=o(a),r(n,this,f)}},ff}(),n=Kf();return Of=function(e){return n(t(e,void 0,r),e+"")}}au(Cf);var Xf,Zf=function(){if(Rf)return wf;Rf=1;var r=function(){if(Qa)return Ka;Qa=1;var r=qf(),t=Jf();return Ka=function(n,e){return r(n,e,(function(r,e){return t(n,e)}))}}(),t=Qf()((function(t,n){return null==t?{}:r(t,n)}));return wf=t}();au(Zf);var rs=function(){function r(r){void 0===r&&(r={}),this.options=r,this[Xf]="JSONSerializer"}return r.prototype.createReplacer=function(r){return Array.isArray(r)?r:null===r?function(r,t){return"string"==typeof t?t.replace(/\r\n/g,"\n"):t}:"function"==typeof r?function(t,n){var e="string"==typeof n?n.replace(/\r\n/g,"\n"):n;return r.call(this,t,e)}:function(r,t){return"string"==typeof t?t.replace(/\r\n/g,"\n"):t}},r.prototype.stringify=function(r,t,n){try{var e=this.createReplacer(t);return Array.isArray(e)?JSON.stringify(r,e,n):JSON.stringify(r,e,null!=n?n:this.options.pretty?this.options.indent||2:void 0)}catch(r){if(r instanceof TypeError&&r.message.includes("circular"))throw new TypeError("Cannot stringify data with circular references");throw r}},r.prototype.parse=function(r,t){return JSON.parse(r,t)},r.prototype.serialize=function(r){return this.stringify(r,this.options.replacer||null,this.options.pretty?this.options.indent||2:void 0)},r.prototype.deserialize=function(r,t){try{return this.parse(r)}catch(r){return t}},r.prototype.serializeArray=function(r){return"["+r.map((function(r){return JSON.stringify(r)})).join(",")+"]"},r}();Xf=Symbol.toStringTag,function(){function r(r,t){void 0===t&&(t=new rs),this.storage=r,this.serializer=t,this.store={}}Object.defineProperty(r.prototype,"length",{get:function(){return this.storage?this.storage.length:Object.keys(this.store).length},enumerable:!1,configurable:!0}),r.prototype.setItem=function(r,t,n){var e={key:r,value:t,expire:n};"number"==typeof n&&n>0&&(e.expire=n);var o=this.serializer.serialize(e);this.storage?this.storage.setItem(r,o):this.store[r]=o},r.prototype.getItem=function(r,t){var n,e=this.storage?this.storage.getItem(r):this.store[r],o=null!=t?t:null;if(!e)return o;var i=this.serializer.deserialize(e,o);return"object"==typeof i?"number"==typeof i.expire&&i.expire<Date.now()?(this.removeItem(r),o):null!==(n=null==i?void 0:i.value)&&void 0!==n?n:o:o},r.prototype.removeItem=function(r){this.storage?this.storage.removeItem(r):delete this.store[r]},r.prototype.clear=function(){this.storage?this.storage.clear():this.store={}}}();const ts=(r=0)=>t=>`[${t+r}m`,ns=(r=0)=>t=>`[${38+r};5;${t}m`,es=(r=0)=>(t,n,e)=>`[${38+r};2;${t};${n};${e}m`,os={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]}};const is=function(){const r=new Map;for(const[t,n]of Object.entries(os)){for(const[t,e]of Object.entries(n))os[t]={open:`[${e[0]}m`,close:`[${e[1]}m`},n[t]=os[t],r.set(e[0],e[1]);Object.defineProperty(os,t,{value:n,enumerable:!1})}return Object.defineProperty(os,"codes",{value:r,enumerable:!1}),os.color.close="[39m",os.bgColor.close="[49m",os.color.ansi=ts(),os.color.ansi256=ns(),os.color.ansi16m=es(),os.bgColor.ansi=ts(10),os.bgColor.ansi256=ns(10),os.bgColor.ansi16m=es(10),Object.defineProperties(os,{rgbToAnsi256:{value:(r,t,n)=>r===t&&t===n?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value(r){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!t)return[0,0,0];let[n]=t;3===n.length&&(n=[...n].map((r=>r+r)).join(""));const e=Number.parseInt(n,16);return[e>>16&255,e>>8&255,255&e]},enumerable:!1},hexToAnsi256:{value:r=>os.rgbToAnsi256(...os.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return r-8+90;let t,n,e;if(r>=232)t=(10*(r-232)+8)/255,n=t,e=t;else{const o=(r-=16)%36;t=Math.floor(r/36)/5,n=Math.floor(o/6)/5,e=o%6/5}const o=2*Math.max(t,n,e);if(0===o)return 30;let i=30+(Math.round(e)<<2|Math.round(n)<<1|Math.round(t));return 2===o&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(r,t,n)=>os.ansi256ToAnsi(os.rgbToAnsi256(r,t,n)),enumerable:!1},hexToAnsi:{value:r=>os.ansi256ToAnsi(os.hexToAnsi256(r)),enumerable:!1}}),os}(),us=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const r=navigator.userAgentData.brands.find((({brand:r})=>"Chromium"===r));if(r&&r.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),cs=0!==us&&{level:us},as={stdout:cs,stderr:cs};function fs(r,t,n){let e=r.indexOf(t);if(-1===e)return r;const o=t.length;let i=0,u="";do{u+=r.slice(i,e)+t+n,i=e+o,e=r.indexOf(t,i)}while(-1!==e);return u+=r.slice(i),u}const{stdout:ss,stderr:ls}=as,ps=Symbol("GENERATOR"),hs=Symbol("STYLER"),vs=Symbol("IS_EMPTY"),gs=["ansi","ansi","ansi256","ansi16m"],ys=Object.create(null),ds=r=>{const t=(...r)=>r.join(" ");return((r,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const n=ss?ss.level:0;r.level=void 0===t.level?n:t.level})(t,r),Object.setPrototypeOf(t,bs.prototype),t};function bs(r){return ds(r)}Object.setPrototypeOf(bs.prototype,Function.prototype);for(const[r,t]of Object.entries(is))ys[r]={get(){const n=ws(this,js(t.open,t.close,this[hs]),this[vs]);return Object.defineProperty(this,r,{value:n}),n}};ys.visible={get(){const r=ws(this,this[hs],!0);return Object.defineProperty(this,"visible",{value:r}),r}};const _s=(r,t,n,...e)=>"rgb"===r?"ansi16m"===t?is[n].ansi16m(...e):"ansi256"===t?is[n].ansi256(is.rgbToAnsi256(...e)):is[n].ansi(is.rgbToAnsi(...e)):"hex"===r?_s("rgb",t,n,...is.hexToRgb(...e)):is[n][r](...e),ms=["rgb","hex","ansi256"];for(const r of ms){ys[r]={get(){const{level:t}=this;return function(...n){const e=js(_s(r,gs[t],"color",...n),is.color.close,this[hs]);return ws(this,e,this[vs])}}};ys["bg"+r[0].toUpperCase()+r.slice(1)]={get(){const{level:t}=this;return function(...n){const e=js(_s(r,gs[t],"bgColor",...n),is.bgColor.close,this[hs]);return ws(this,e,this[vs])}}}}const Os=Object.defineProperties((()=>{}),{...ys,level:{enumerable:!0,get(){return this[ps].level},set(r){this[ps].level=r}}}),js=(r,t,n)=>{let e,o;return void 0===n?(e=r,o=t):(e=n.openAll+r,o=t+n.closeAll),{open:r,close:t,openAll:e,closeAll:o,parent:n}},ws=(r,t,n)=>{const e=(...r)=>Rs(e,1===r.length?""+r[0]:r.join(" "));return Object.setPrototypeOf(e,Os),e[ps]=r,e[hs]=t,e[vs]=n,e},Rs=(r,t)=>{if(r.level<=0||!t)return r[vs]?"":t;let n=r[hs];if(void 0===n)return t;const{openAll:e,closeAll:o}=n;if(t.includes(""))for(;void 0!==n;)t=fs(t,n.close,n.open),n=n.parent;const i=t.indexOf("\n");return-1!==i&&(t=function(r,t,n,e){let o=0,i="";do{const u="\r"===r[e-1];i+=r.slice(o,u?e-1:e)+t+(u?"\r\n":"\n")+n,o=e+1,e=r.indexOf("\n",o)}while(-1!==e);return i+=r.slice(o),i}(t,o,e,i)),e+t+o};Object.defineProperties(bs.prototype,ys);const xs=bs();bs({level:ls?ls.level:0});class ks extends Nf{prefix(r){switch(r){case"INFO":return xs.blue(r);case"WARN":return xs.yellow(r);case"ERROR":return xs.red(r);case"DEBUG":return xs.gray(r);default:return r}}obtrusive(r){const t=xs.bold(r);super.obtrusive(t)}}const Ps=(r,t)=>{const n=Array.isArray(r)?r.join(" "):r;return new Promise(((r,e)=>{ct.exec(n,{encoding:"utf-8",...t},((t,n,o)=>{t||o?e(t||o):r(n)}))}))};function Ss(r){return new To({name:"fe-config",defaultConfig:Yi({},Co,r)})}exports.ConfigSearch=To,exports.FeScriptContext=class{logger;shell;feConfig;dryRun;verbose;options;constructor(r){const{logger:t,shell:n,feConfig:e,dryRun:o,verbose:i,options:u}=r||{},c=u||{};this.logger=t||new ks({debug:i,dryRun:o}),this.shell=n||new Wi({logger:this.logger,dryRun:o,execPromise:c.execPromise||Ps}),this.feConfig=Ss(e).config,this.dryRun=!!o,this.verbose=!!i,this.options=c}},exports.ScriptsLogger=ks,exports.Shell=Wi,exports.defaultFeConfig=Co,exports.getFeConfigSearch=Ss;
|
package/dist/es/index.d.ts
CHANGED
|
@@ -272,73 +272,105 @@ type FeReleaseConfig = {
|
|
|
272
272
|
packagesDirectories?: string[];
|
|
273
273
|
};
|
|
274
274
|
|
|
275
|
-
declare class ScriptsLogger extends Logger {
|
|
276
|
-
/**
|
|
277
|
-
* @override
|
|
278
|
-
* @param {string} value
|
|
279
|
-
* @returns {string}
|
|
280
|
-
*/
|
|
281
|
-
prefix(value: string): string;
|
|
282
|
-
obtrusive(title: string): void;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Configuration interface for Shell class
|
|
287
|
-
* @interface
|
|
288
|
-
*/
|
|
289
|
-
interface ShellConfig {
|
|
290
|
-
/** Whether to run in dry-run mode */
|
|
291
|
-
isDryRun?: boolean;
|
|
292
|
-
/** Logger instance */
|
|
293
|
-
log: Logger;
|
|
294
|
-
}
|
|
295
275
|
/**
|
|
296
276
|
* Options for shell execution
|
|
277
|
+
*
|
|
278
|
+
* This interface defines the options available for executing shell commands.
|
|
279
|
+
* It provides flexibility in controlling the behavior of shell command execution.
|
|
280
|
+
*
|
|
297
281
|
* @interface
|
|
282
|
+
* @example
|
|
283
|
+
* const options: ShellExecOptions = {
|
|
284
|
+
* silent: true,
|
|
285
|
+
* env: { PATH: '/usr/bin' },
|
|
286
|
+
* dryRun: false
|
|
287
|
+
* };
|
|
298
288
|
*/
|
|
299
289
|
interface ShellExecOptions {
|
|
300
290
|
/**
|
|
301
|
-
* Whether to suppress output to the console
|
|
291
|
+
* Whether to suppress output to the console.
|
|
292
|
+
*
|
|
293
|
+
* @type {boolean}
|
|
302
294
|
*/
|
|
303
295
|
silent?: boolean;
|
|
304
296
|
/**
|
|
305
|
-
* Environment variables to be passed to the command
|
|
297
|
+
* Environment variables to be passed to the command.
|
|
298
|
+
*
|
|
299
|
+
* @type {Record<string, string>}
|
|
306
300
|
*/
|
|
307
301
|
env?: Record<string, string>;
|
|
308
302
|
/**
|
|
309
|
-
* Result to return when in dry-run mode
|
|
303
|
+
* Result to return when in dry-run mode.
|
|
304
|
+
*
|
|
305
|
+
* @type {unknown}
|
|
310
306
|
*/
|
|
311
307
|
dryRunResult?: unknown;
|
|
312
308
|
/**
|
|
313
|
-
* Whether to perform a dry run
|
|
314
|
-
* Overrides shell config.isDryRun if set
|
|
309
|
+
* Whether to perform a dry run.
|
|
310
|
+
* Overrides shell config.isDryRun if set.
|
|
311
|
+
*
|
|
312
|
+
* @type {boolean}
|
|
315
313
|
*/
|
|
316
314
|
dryRun?: boolean;
|
|
317
315
|
/**
|
|
318
|
-
*
|
|
316
|
+
* Template context for command string interpolation.
|
|
317
|
+
*
|
|
318
|
+
* @type {Record<string, unknown>}
|
|
319
319
|
*/
|
|
320
|
-
|
|
320
|
+
context?: Record<string, unknown>;
|
|
321
321
|
/**
|
|
322
|
-
*
|
|
322
|
+
* Encoding for command output.
|
|
323
|
+
*
|
|
324
|
+
* @type {string}
|
|
323
325
|
*/
|
|
324
|
-
|
|
326
|
+
encoding?: string;
|
|
327
|
+
[key: string]: unknown;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Interface for shell execution
|
|
331
|
+
*
|
|
332
|
+
* This interface defines a method for executing shell commands.
|
|
333
|
+
* It abstracts the details of shell command execution and provides a consistent interface.
|
|
334
|
+
*
|
|
335
|
+
* @interface
|
|
336
|
+
* @example
|
|
337
|
+
* const shell: ShellInterface = {
|
|
338
|
+
* exec: async (command, options) => {
|
|
339
|
+
* // Logic to execute the command
|
|
340
|
+
* return 'Command output';
|
|
341
|
+
* }
|
|
342
|
+
* };
|
|
343
|
+
*/
|
|
344
|
+
interface ShellInterface {
|
|
345
|
+
/**
|
|
346
|
+
* Execute a command.
|
|
347
|
+
*
|
|
348
|
+
* @param {string | string[]} command - The command to execute.
|
|
349
|
+
* @param {ShellExecOptions} [options] - Options for the command execution.
|
|
350
|
+
* @returns {Promise<string>} The output of the command.
|
|
351
|
+
*/
|
|
352
|
+
exec(command: string | string[], options?: ShellExecOptions): Promise<string>;
|
|
325
353
|
}
|
|
354
|
+
|
|
355
|
+
type ExecPromiseFunction = (command: string | string[], options: ShellExecOptions) => Promise<string>;
|
|
326
356
|
/**
|
|
327
|
-
*
|
|
357
|
+
* Configuration interface for Shell class
|
|
328
358
|
* @interface
|
|
329
359
|
*/
|
|
330
|
-
interface
|
|
331
|
-
/**
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
|
|
360
|
+
interface ShellConfig extends ShellExecOptions {
|
|
361
|
+
/** Logger instance */
|
|
362
|
+
logger: Logger;
|
|
363
|
+
/**
|
|
364
|
+
* Promise for the execer
|
|
365
|
+
*/
|
|
366
|
+
execPromise?: ExecPromiseFunction;
|
|
335
367
|
}
|
|
336
368
|
/**
|
|
337
369
|
* Shell class for command execution
|
|
338
370
|
* @class
|
|
339
371
|
* @description Provides methods for executing shell commands with caching and templating support
|
|
340
372
|
*/
|
|
341
|
-
declare class Shell {
|
|
373
|
+
declare class Shell implements ShellInterface {
|
|
342
374
|
config: ShellConfig;
|
|
343
375
|
private cache;
|
|
344
376
|
/**
|
|
@@ -387,21 +419,6 @@ declare class Shell {
|
|
|
387
419
|
* @returns Promise resolving to command output
|
|
388
420
|
*/
|
|
389
421
|
execFormattedCommand(command: string | string[], options?: ShellExecOptions): Promise<string>;
|
|
390
|
-
/**
|
|
391
|
-
* Executes a string command using shelljs
|
|
392
|
-
* @param command - Command string
|
|
393
|
-
* @param options - Execution options
|
|
394
|
-
* @returns Promise resolving to command output
|
|
395
|
-
*/
|
|
396
|
-
execStringCommand(command: string, options: ShellExecOptions): Promise<string>;
|
|
397
|
-
/**
|
|
398
|
-
* Executes a command with arguments using execa
|
|
399
|
-
* @param command - Command array
|
|
400
|
-
* @param options - Execution options
|
|
401
|
-
* @param meta - Execution metadata
|
|
402
|
-
* @returns Promise resolving to command output
|
|
403
|
-
*/
|
|
404
|
-
execWithArguments(command: string[], options: ShellExecOptions, meta: ExecMeta): Promise<string>;
|
|
405
422
|
}
|
|
406
423
|
|
|
407
424
|
/**
|
|
@@ -420,6 +437,9 @@ declare class Shell {
|
|
|
420
437
|
* ```
|
|
421
438
|
*/
|
|
422
439
|
declare function getFeConfigSearch(feConfig?: Record<string, unknown>): ConfigSearch;
|
|
440
|
+
type ScriptContextOptions<T> = T & {
|
|
441
|
+
execPromise?: ExecPromiseFunction;
|
|
442
|
+
};
|
|
423
443
|
/**
|
|
424
444
|
* Options interface for FeScriptContext
|
|
425
445
|
* @interface
|
|
@@ -439,7 +459,7 @@ declare function getFeConfigSearch(feConfig?: Record<string, unknown>): ConfigSe
|
|
|
439
459
|
*/
|
|
440
460
|
interface FeScriptContextOptions<T> {
|
|
441
461
|
/** Custom logger instance */
|
|
442
|
-
logger?:
|
|
462
|
+
logger?: Logger;
|
|
443
463
|
/** Shell instance for command execution */
|
|
444
464
|
shell?: Shell;
|
|
445
465
|
/** Custom fe configuration */
|
|
@@ -449,7 +469,7 @@ interface FeScriptContextOptions<T> {
|
|
|
449
469
|
/** Enable verbose logging */
|
|
450
470
|
verbose?: boolean;
|
|
451
471
|
/** Additional script-specific options */
|
|
452
|
-
options?: T
|
|
472
|
+
options?: ScriptContextOptions<T>;
|
|
453
473
|
}
|
|
454
474
|
/**
|
|
455
475
|
* Script execution context class
|
|
@@ -470,7 +490,7 @@ interface FeScriptContextOptions<T> {
|
|
|
470
490
|
*/
|
|
471
491
|
declare class FeScriptContext<T = unknown> {
|
|
472
492
|
/** Logger instance */
|
|
473
|
-
readonly logger:
|
|
493
|
+
readonly logger: Logger;
|
|
474
494
|
/** Shell instance */
|
|
475
495
|
readonly shell: Shell;
|
|
476
496
|
/** Fe configuration */
|
|
@@ -480,7 +500,7 @@ declare class FeScriptContext<T = unknown> {
|
|
|
480
500
|
/** Verbose logging flag */
|
|
481
501
|
readonly verbose: boolean;
|
|
482
502
|
/** Script-specific options */
|
|
483
|
-
options: T
|
|
503
|
+
options: ScriptContextOptions<T>;
|
|
484
504
|
/**
|
|
485
505
|
* Creates a FeScriptContext instance
|
|
486
506
|
*
|
|
@@ -501,4 +521,14 @@ declare class FeScriptContext<T = unknown> {
|
|
|
501
521
|
constructor(scriptsOptions?: FeScriptContextOptions<T>);
|
|
502
522
|
}
|
|
503
523
|
|
|
504
|
-
|
|
524
|
+
declare class ScriptsLogger extends Logger {
|
|
525
|
+
/**
|
|
526
|
+
* @override
|
|
527
|
+
* @param {string} value
|
|
528
|
+
* @returns {string}
|
|
529
|
+
*/
|
|
530
|
+
prefix(value: string): string;
|
|
531
|
+
obtrusive(title: string): void;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
export { ConfigSearch, type ConfigSearchOptions, type ExecPromiseFunction, type FeConfig, type FeReleaseConfig, FeScriptContext, type FeScriptContextOptions, type ScriptContextOptions, ScriptsLogger, Shell, type ShellConfig, type ShellExecOptions, type ShellInterface, defaultFeConfig, getFeConfigSearch };
|
package/dist/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cosmiconfigSync as r}from"cosmiconfig";import n from"merge";import{Logger as t}from"@qlover/fe-utils";import e from"chalk";import o from"shelljs";var u,i,c,a,f,s,l,p,v,h,g,b,y,d,j,m,O,_,w,P,x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function $(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function R(){if(i)return u;i=1;var r="object"==typeof x&&x&&x.Object===Object&&x;return u=r}function A(){if(a)return c;a=1;var r=R(),n="object"==typeof self&&self&&self.Object===Object&&self,t=r||n||Function("return this")();return c=t}function S(){if(s)return f;s=1;var r=A().Symbol;return f=r}function E(){if(p)return l;p=1;var r=S(),n=Object.prototype,t=n.hasOwnProperty,e=n.toString,o=r?r.toStringTag:void 0;return l=function(r){var n=t.call(r,o),u=r[o];try{r[o]=void 0;var i=!0}catch(r){}var c=e.call(r);return i&&(n?r[o]=u:delete r[o]),c}}function C(){if(h)return v;h=1;var r=Object.prototype.toString;return v=function(n){return r.call(n)}}function F(){if(b)return g;b=1;var r=S(),n=E(),t=C(),e=r?r.toStringTag:void 0;return g=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":e&&e in Object(r)?n(r):t(r)}}function k(){if(d)return y;return d=1,y=function(r,n){return function(t){return r(n(t))}}}function T(){if(m)return j;m=1;var r=k()(Object.getPrototypeOf,Object);return j=r}function M(){if(_)return O;return _=1,O=function(r){return null!=r&&"object"==typeof r}}function D(){if(P)return w;P=1;var r=F(),n=T(),t=M(),e=Function.prototype,o=Object.prototype,u=e.toString,i=o.hasOwnProperty,c=u.call(Object);return w=function(e){if(!t(e)||"[object Object]"!=r(e))return!1;var o=n(e);if(null===o)return!0;var a=i.call(o,"constructor")&&o.constructor;return"function"==typeof a&&a instanceof a&&u.call(a)==c}}var N=$(D());class B{name;searchPlaces;_config;loaders;searchCache;constructor(r){const{name:n,searchPlaces:t,defaultConfig:e,loaders:o}=r;if(!n&&!t)throw new Error("searchPlaces or name is required");this.name=n,this.searchPlaces=t||function(r){const n=["json","js","ts","cjs","yaml","yml"];return["package.json",...n.map((n=>`${r}.${n}`)),...n.map((n=>`.${r}.${n}`))]}(n),this._config=e||{},this.loaders=o}get config(){return n({},this._config,this.search())}getSearchPlaces(){return this.searchPlaces}get(n={}){const{file:t,dir:e=process.cwd()}=n,o={};if(!1===t)return o;const u=r(this.name,{searchPlaces:this.searchPlaces,loaders:this.loaders}),i=t?u.load(t):u.search(e);if(i&&"string"==typeof i.config)throw new Error(`Invalid configuration file at ${i.filepath}`);return i&&N(i.config)?i.config:o}search(){return this.searchCache?this.searchCache:this.searchCache=this.get({})}}const U={protectedBranches:["master","develop","main"],cleanFiles:["dist","node_modules","yarn.lock","package-lock.json",".eslintcache","*.log"],commitlint:{extends:["@commitlint/config-conventional"]},release:{publishPath:"",autoMergeReleasePR:!1,autoMergeType:"squash",branchName:"release-${env}-${branch}-${tagName}",PRTitle:"[${pkgName} Release] Branch:${branch}, Tag:${tagName}, Env:${env}",PRBody:"## Publish Details\n\n- 🏷️ Version: ${tagName}\n- 🌲 Branch: ${branch}\n- 🔧 Environment: ${env}\n\n## Changelog\n\n${changelog}\n\n## Notes\n\n- [ ] Please check if the version number is correct\n- [ ] Please confirm all tests have passed\n- [ ] Please confirm the documentation has been updated\n\n> This PR is auto created by release process, please contact the frontend team if there are any questions.",label:{color:"1A7F37",description:"Release PR",name:"CI-Release"},packagesDirectories:[],changePackagesLabel:"changes:${name}"},envOrder:[".env.local",".env.production",".env"]};class I extends t{prefix(r){switch(r){case"INFO":return e.blue(r);case"WARN":return e.yellow(r);case"ERROR":return e.red(r);case"DEBUG":return e.gray(r);default:return r}}obtrusive(r){const n=e.bold(r);super.obtrusive(n)}}var q,W,L,V,G,z,J,H,K,Q,X,Y,Z,rr,nr,tr,er,or,ur,ir,cr,ar,fr,sr,lr,pr,vr,hr,gr,br,yr,dr,jr,mr,Or,_r,wr,Pr,xr,$r,Rr,Ar,Sr,Er;function Cr(){if(W)return q;W=1;var r=Object.prototype;return q=function(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||r)}}function Fr(){if(V)return L;V=1;var r=k()(Object.keys,Object);return L=r}function kr(){if(z)return G;z=1;var r=Cr(),n=Fr(),t=Object.prototype.hasOwnProperty;return G=function(e){if(!r(e))return n(e);var o=[];for(var u in Object(e))t.call(e,u)&&"constructor"!=u&&o.push(u);return o}}function Tr(){if(H)return J;return H=1,J=function(r){var n=typeof r;return null!=r&&("object"==n||"function"==n)}}function Mr(){if(Q)return K;Q=1;var r=F(),n=Tr();return K=function(t){if(!n(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}}function Dr(){if(Y)return X;Y=1;var r=A()["__core-js_shared__"];return X=r}function Nr(){if(rr)return Z;rr=1;var r,n=Dr(),t=(r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";return Z=function(r){return!!t&&t in r}}function Br(){if(tr)return nr;tr=1;var r=Function.prototype.toString;return nr=function(n){if(null!=n){try{return r.call(n)}catch(r){}try{return n+""}catch(r){}}return""}}function Ur(){if(or)return er;or=1;var r=Mr(),n=Nr(),t=Tr(),e=Br(),o=/^\[object .+?Constructor\]$/,u=Function.prototype,i=Object.prototype,c=u.toString,a=i.hasOwnProperty,f=RegExp("^"+c.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return er=function(u){return!(!t(u)||n(u))&&(r(u)?f:o).test(e(u))}}function Ir(){if(ir)return ur;return ir=1,ur=function(r,n){return null==r?void 0:r[n]}}function qr(){if(ar)return cr;ar=1;var r=Ur(),n=Ir();return cr=function(t,e){var o=n(t,e);return r(o)?o:void 0}}function Wr(){if(sr)return fr;sr=1;var r=qr()(A(),"DataView");return fr=r}function Lr(){if(pr)return lr;pr=1;var r=qr()(A(),"Map");return lr=r}function Vr(){if(hr)return vr;hr=1;var r=qr()(A(),"Promise");return vr=r}function Gr(){if(br)return gr;br=1;var r=qr()(A(),"Set");return gr=r}function zr(){if(dr)return yr;dr=1;var r=qr()(A(),"WeakMap");return yr=r}function Jr(){if(mr)return jr;mr=1;var r=Wr(),n=Lr(),t=Vr(),e=Gr(),o=zr(),u=F(),i=Br(),c="[object Map]",a="[object Promise]",f="[object Set]",s="[object WeakMap]",l="[object DataView]",p=i(r),v=i(n),h=i(t),g=i(e),b=i(o),y=u;return(r&&y(new r(new ArrayBuffer(1)))!=l||n&&y(new n)!=c||t&&y(t.resolve())!=a||e&&y(new e)!=f||o&&y(new o)!=s)&&(y=function(r){var n=u(r),t="[object Object]"==n?r.constructor:void 0,e=t?i(t):"";if(e)switch(e){case p:return l;case v:return c;case h:return a;case g:return f;case b:return s}return n}),jr=y}function Hr(){if(_r)return Or;_r=1;var r=F(),n=M();return Or=function(t){return n(t)&&"[object Arguments]"==r(t)}}function Kr(){if(Pr)return wr;Pr=1;var r=Hr(),n=M(),t=Object.prototype,e=t.hasOwnProperty,o=t.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(r){return n(r)&&e.call(r,"callee")&&!o.call(r,"callee")};return wr=u}function Qr(){if($r)return xr;$r=1;var r=Array.isArray;return xr=r}function Xr(){if(Ar)return Rr;Ar=1;return Rr=function(r){return"number"==typeof r&&r>-1&&r%1==0&&r<=9007199254740991}}function Yr(){if(Er)return Sr;Er=1;var r=Mr(),n=Xr();return Sr=function(t){return null!=t&&n(t.length)&&!r(t)}}var Zr,rn,nn,tn,en,on,un,cn={exports:{}};function an(){if(rn)return Zr;return rn=1,Zr=function(){return!1}}function fn(){return nn||(nn=1,function(r,n){var t=A(),e=an(),o=n&&!n.nodeType&&n,u=o&&r&&!r.nodeType&&r,i=u&&u.exports===o?t.Buffer:void 0,c=(i?i.isBuffer:void 0)||e;r.exports=c}(cn,cn.exports)),cn.exports}function sn(){if(en)return tn;en=1;var r=F(),n=Xr(),t=M(),e={};return e["[object Float32Array]"]=e["[object Float64Array]"]=e["[object Int8Array]"]=e["[object Int16Array]"]=e["[object Int32Array]"]=e["[object Uint8Array]"]=e["[object Uint8ClampedArray]"]=e["[object Uint16Array]"]=e["[object Uint32Array]"]=!0,e["[object Arguments]"]=e["[object Array]"]=e["[object ArrayBuffer]"]=e["[object Boolean]"]=e["[object DataView]"]=e["[object Date]"]=e["[object Error]"]=e["[object Function]"]=e["[object Map]"]=e["[object Number]"]=e["[object Object]"]=e["[object RegExp]"]=e["[object Set]"]=e["[object String]"]=e["[object WeakMap]"]=!1,tn=function(o){return t(o)&&n(o.length)&&!!e[r(o)]}}function ln(){if(un)return on;return un=1,on=function(r){return function(n){return r(n)}}}var pn,vn,hn,gn,bn,yn={exports:{}};function dn(){return pn||(pn=1,r=yn,n=yn.exports,t=R(),e=n&&!n.nodeType&&n,o=e&&r&&!r.nodeType&&r,u=o&&o.exports===e&&t.process,i=function(){try{var r=o&&o.require&&o.require("util").types;return r||u&&u.binding&&u.binding("util")}catch(r){}}(),r.exports=i),yn.exports;var r,n,t,e,o,u,i}function jn(){if(hn)return vn;hn=1;var r=sn(),n=ln(),t=dn(),e=t&&t.isTypedArray,o=e?n(e):r;return vn=o}function mn(){if(bn)return gn;bn=1;var r=kr(),n=Jr(),t=Kr(),e=Qr(),o=Yr(),u=fn(),i=Cr(),c=jn(),a=Object.prototype.hasOwnProperty;return gn=function(f){if(null==f)return!0;if(o(f)&&(e(f)||"string"==typeof f||"function"==typeof f.splice||u(f)||c(f)||t(f)))return!f.length;var s=n(f);if("[object Map]"==s||"[object Set]"==s)return!f.size;if(i(f))return!r(f).length;for(var l in f)if(a.call(f,l))return!1;return!0}}var On,_n,wn,Pn,xn,$n,Rn,An,Sn,En,Cn,Fn,kn,Tn,Mn,Dn,Nn,Bn,Un,In,qn,Wn,Ln,Vn,Gn,zn,Jn,Hn,Kn,Qn,Xn,Yn,Zn,rt,nt,tt,et,ot,ut,it,ct,at,ft,st,lt,pt,vt,ht,gt,bt,yt,dt,jt,mt,Ot,_t,wt,Pt,xt,$t,Rt,At,St,Et,Ct,Ft,kt,Tt,Mt,Dt,Nt,Bt,Ut,It,qt,Wt,Lt,Vt,Gt,zt,Jt=$(mn());function Ht(){if(_n)return On;_n=1;var r=qr(),n=function(){try{var n=r(Object,"defineProperty");return n({},"",{}),n}catch(r){}}();return On=n}function Kt(){if(Pn)return wn;Pn=1;var r=Ht();return wn=function(n,t,e){"__proto__"==t&&r?r(n,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):n[t]=e}}function Qt(){if($n)return xn;return $n=1,xn=function(r,n){return r===n||r!=r&&n!=n}}function Xt(){if(An)return Rn;An=1;var r=Kt(),n=Qt(),t=Object.prototype.hasOwnProperty;return Rn=function(e,o,u){var i=e[o];t.call(e,o)&&n(i,u)&&(void 0!==u||o in e)||r(e,o,u)}}function Yt(){if(En)return Sn;En=1;var r=Xt(),n=Kt();return Sn=function(t,e,o,u){var i=!o;o||(o={});for(var c=-1,a=e.length;++c<a;){var f=e[c],s=u?u(o[f],t[f],f,o,t):void 0;void 0===s&&(s=t[f]),i?n(o,f,s):r(o,f,s)}return o}}function Zt(){if(Fn)return Cn;return Fn=1,Cn=function(r){return r}}function re(){if(Tn)return kn;return Tn=1,kn=function(r,n,t){switch(t.length){case 0:return r.call(n);case 1:return r.call(n,t[0]);case 2:return r.call(n,t[0],t[1]);case 3:return r.call(n,t[0],t[1],t[2])}return r.apply(n,t)}}function ne(){if(Dn)return Mn;Dn=1;var r=re(),n=Math.max;return Mn=function(t,e,o){return e=n(void 0===e?t.length-1:e,0),function(){for(var u=arguments,i=-1,c=n(u.length-e,0),a=Array(c);++i<c;)a[i]=u[e+i];i=-1;for(var f=Array(e+1);++i<e;)f[i]=u[i];return f[e]=o(a),r(t,this,f)}},Mn}function te(){if(Bn)return Nn;return Bn=1,Nn=function(r){return function(){return r}}}function ee(){if(In)return Un;In=1;var r=te(),n=Ht();return Un=n?function(t,e){return n(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:Zt()}function oe(){if(Wn)return qn;Wn=1;var r=Date.now;return qn=function(n){var t=0,e=0;return function(){var o=r(),u=16-(o-e);if(e=o,u>0){if(++t>=800)return arguments[0]}else t=0;return n.apply(void 0,arguments)}},qn}function ue(){if(Vn)return Ln;Vn=1;var r=ee(),n=oe()(r);return Ln=n}function ie(){if(zn)return Gn;zn=1;var r=Zt(),n=ne(),t=ue();return Gn=function(e,o){return t(n(e,o,r),e+"")}}function ce(){if(Hn)return Jn;Hn=1;var r=/^(?:0|[1-9]\d*)$/;return Jn=function(n,t){var e=typeof n;return!!(t=null==t?9007199254740991:t)&&("number"==e||"symbol"!=e&&r.test(n))&&n>-1&&n%1==0&&n<t}}function ae(){if(Qn)return Kn;Qn=1;var r=Qt(),n=Yr(),t=ce(),e=Tr();return Kn=function(o,u,i){if(!e(i))return!1;var c=typeof u;return!!("number"==c?n(i)&&t(u,i.length):"string"==c&&u in i)&&r(i[u],o)}}function fe(){if(Yn)return Xn;Yn=1;var r=ie(),n=ae();return Xn=function(t){return r((function(r,e){var o=-1,u=e.length,i=u>1?e[u-1]:void 0,c=u>2?e[2]:void 0;for(i=t.length>3&&"function"==typeof i?(u--,i):void 0,c&&n(e[0],e[1],c)&&(i=u<3?void 0:i,u=1),r=Object(r);++o<u;){var a=e[o];a&&t(r,a,o,i)}return r}))}}function se(){if(rt)return Zn;return rt=1,Zn=function(r,n){for(var t=-1,e=Array(r);++t<r;)e[t]=n(t);return e}}function le(){if(tt)return nt;tt=1;var r=se(),n=Kr(),t=Qr(),e=fn(),o=ce(),u=jn(),i=Object.prototype.hasOwnProperty;return nt=function(c,a){var f=t(c),s=!f&&n(c),l=!f&&!s&&e(c),p=!f&&!s&&!l&&u(c),v=f||s||l||p,h=v?r(c.length,String):[],g=h.length;for(var b in c)!a&&!i.call(c,b)||v&&("length"==b||l&&("offset"==b||"parent"==b)||p&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||o(b,g))||h.push(b);return h}}function pe(){if(ot)return et;return ot=1,et=function(r){var n=[];if(null!=r)for(var t in Object(r))n.push(t);return n}}function ve(){if(it)return ut;it=1;var r=Tr(),n=Cr(),t=pe(),e=Object.prototype.hasOwnProperty;return ut=function(o){if(!r(o))return t(o);var u=n(o),i=[];for(var c in o)("constructor"!=c||!u&&e.call(o,c))&&i.push(c);return i}}function he(){if(at)return ct;at=1;var r=le(),n=ve(),t=Yr();return ct=function(e){return t(e)?r(e,!0):n(e)}}function ge(){if(st)return ft;st=1;var r=Yt(),n=fe(),t=he(),e=n((function(n,e,o,u){r(e,t(e),n,u)}));return ft=e}function be(){if(pt)return lt;pt=1;var r=F(),n=M(),t=D();return lt=function(e){if(!n(e))return!1;var o=r(e);return"[object Error]"==o||"[object DOMException]"==o||"string"==typeof e.message&&"string"==typeof e.name&&!t(e)}}function ye(){if(ht)return vt;ht=1;var r=re(),n=ie(),t=be(),e=n((function(n,e){try{return r(n,void 0,e)}catch(r){return t(r)?r:new Error(r)}}));return vt=e}function de(){if(bt)return gt;return bt=1,gt=function(r,n){for(var t=-1,e=null==r?0:r.length,o=Array(e);++t<e;)o[t]=n(r[t],t,r);return o}}function je(){if(dt)return yt;dt=1;var r=de();return yt=function(n,t){return r(t,(function(r){return n[r]}))}}function me(){if(mt)return jt;mt=1;var r=Qt(),n=Object.prototype,t=n.hasOwnProperty;return jt=function(e,o,u,i){return void 0===e||r(e,n[u])&&!t.call(i,u)?o:e}}function Oe(){if(_t)return Ot;_t=1;var r={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};return Ot=function(n){return"\\"+r[n]}}function _e(){if(Pt)return wt;Pt=1;var r=le(),n=kr(),t=Yr();return wt=function(e){return t(e)?r(e):n(e)}}function we(){if($t)return xt;$t=1;return xt=/<%=([\s\S]+?)%>/g}function Pe(){if(At)return Rt;return At=1,Rt=function(r){return function(n){return null==r?void 0:r[n]}}}function xe(){if(Et)return St;Et=1;var r=Pe()({"&":"&","<":"<",">":">",'"':""","'":"'"});return St=r}function $e(){if(Ft)return Ct;Ft=1;var r=F(),n=M();return Ct=function(t){return"symbol"==typeof t||n(t)&&"[object Symbol]"==r(t)}}function Re(){if(Tt)return kt;Tt=1;var r=S(),n=de(),t=Qr(),e=$e(),o=r?r.prototype:void 0,u=o?o.toString:void 0;return kt=function r(o){if("string"==typeof o)return o;if(t(o))return n(o,r)+"";if(e(o))return u?u.call(o):"";var i=o+"";return"0"==i&&1/o==-1/0?"-0":i},kt}function Ae(){if(Dt)return Mt;Dt=1;var r=Re();return Mt=function(n){return null==n?"":r(n)}}function Se(){if(Bt)return Nt;Bt=1;var r=xe(),n=Ae(),t=/[&<>"']/g,e=RegExp(t.source);return Nt=function(o){return(o=n(o))&&e.test(o)?o.replace(t,r):o}}function Ee(){if(It)return Ut;It=1;return Ut=/<%-([\s\S]+?)%>/g}function Ce(){if(Wt)return qt;Wt=1;return qt=/<%([\s\S]+?)%>/g}function Fe(){if(Vt)return Lt;Vt=1;var r=Se();return Lt={escape:Ee(),evaluate:Ce(),interpolate:we(),variable:"",imports:{_:{escape:r}}}}function ke(){if(zt)return Gt;zt=1;var r=ge(),n=ye(),t=je(),e=me(),o=Oe(),u=be(),i=ae(),c=_e(),a=we(),f=Fe(),s=Ae(),l=/\b__p \+= '';/g,p=/\b(__p \+=) '' \+/g,v=/(__e\(.*?\)|\b__t\)) \+\n'';/g,h=/[()=,{}\[\]\/\s]/,g=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,b=/($^)/,y=/['\n\r\u2028\u2029\\]/g,d=Object.prototype.hasOwnProperty;return Gt=function(j,m,O){var _=f.imports._.templateSettings||f;O&&i(j,m,O)&&(m=void 0),j=s(j),m=r({},m,_,e);var w,P,x=r({},m.imports,_.imports,e),$=c(x),R=t(x,$),A=0,S=m.interpolate||b,E="__p += '",C=RegExp((m.escape||b).source+"|"+S.source+"|"+(S===a?g:b).source+"|"+(m.evaluate||b).source+"|$","g"),F=d.call(m,"sourceURL")?"//# sourceURL="+(m.sourceURL+"").replace(/\s/g," ")+"\n":"";j.replace(C,(function(r,n,t,e,u,i){return t||(t=e),E+=j.slice(A,i).replace(y,o),n&&(w=!0,E+="' +\n__e("+n+") +\n'"),u&&(P=!0,E+="';\n"+u+";\n__p += '"),t&&(E+="' +\n((__t = ("+t+")) == null ? '' : __t) +\n'"),A=i+r.length,r})),E+="';\n";var k=d.call(m,"variable")&&m.variable;if(k){if(h.test(k))throw new Error("Invalid `variable` option passed into `_.template`")}else E="with (obj) {\n"+E+"\n}\n";E=(P?E.replace(l,""):E).replace(p,"$1").replace(v,"$1;"),E="function("+(k||"obj")+") {\n"+(k?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(w?", __e = _.escape":"")+(P?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+E+"return __p\n}";var T=n((function(){return Function($,F+"return "+E).apply(void 0,R)}));if(T.source=E,u(T))throw T;return T}}var Te=$(ke());class Me{config;cache;constructor(r,n=new Map){this.config=r,this.cache=n}get logger(){return this.config.log}static format(r="",n={}){return Te(r)(n)}format(r="",n={}){try{return Me.format(r,n)}catch(t){throw this.logger.error(`Unable to render template with context:\n${r}\n${JSON.stringify(n)}`),this.logger.error(t),t}}exec(r,n={}){if(Jt(r))return Promise.resolve("");const{context:t,...e}=n;return"string"==typeof r?this.execFormattedCommand(this.format(r,t||{}),e):this.execFormattedCommand(r,e)}run(r,n={}){return this.exec(r,{silent:!0,...n})}async execFormattedCommand(r,n={}){const{dryRunResult:t,silent:e,external:o,dryRun:u}=n,i=void 0!==u?u:this.config.isDryRun,c=!0===o,a="string"==typeof r?r:r.join(" "),f=!c&&this.cache.has(a);if(e||this.logger.exec(r,{isExternal:c,isCached:f}),i)return Promise.resolve(t);if(f)return this.cache.get(a);const s="string"==typeof r?this.execStringCommand(r,n):this.execWithArguments(r,n,{isExternal:c});return c||this.cache.has(a)||this.cache.set(a,s),s}execStringCommand(r,n){return new Promise(((t,e)=>{o.exec(r,{async:!0,...n},((o,u,i)=>{u=u.toString().trimEnd(),0===o?t(u):(n.silent&&this.logger.error(r),e(new Error(i||u)))}))}))}async execWithArguments(r,n,t){const[e,...u]=r;return new Promise(((r,i)=>{o.exec(`${e} ${u.join(" ")}`,{async:!0,...n},((o,c,a)=>{if(0===o){const n=c.trim();this.logger.verbose(n,{isExternal:t.isExternal}),r(n)}else n.silent&&this.logger.error(`${e} ${u.join(" ")}`),i(new Error(a||c))}))}))}}function De(r){return new B({name:"fe-config",defaultConfig:n({},U,r)})}class Ne{logger;shell;feConfig;dryRun;verbose;options;constructor(r){const{logger:n,shell:t,feConfig:e,dryRun:o,verbose:u,options:i}=r||{};this.logger=n||new I({debug:u,dryRun:o}),this.shell=t||new Me({log:this.logger,isDryRun:o}),this.feConfig=De(e).config,this.dryRun=!!o,this.verbose=!!u,this.options=i||{}}}export{B as ConfigSearch,Ne as FeScriptContext,I as ScriptsLogger,Me as Shell,U as defaultFeConfig,De as getFeConfigSearch};
|
|
1
|
+
import{cosmiconfigSync as r}from"cosmiconfig";import{exec as t}from"child_process";var n,e,o,i,u,a,c,f,s,l,p,h,v,y,g,d,b,_,m,O,j,w,R,k,x,P,A,E,N,S,T,C,$,B,z,F,I,M,U,V,D,H,G,L,W,Y,J,q,K,Q,X,Z,rr,tr,nr,er,or,ir,ur,ar,cr,fr,sr,lr,pr,hr,vr,yr,gr,dr,br,_r,mr,Or,jr,wr,Rr,kr,xr,Pr,Ar,Er,Nr,Sr,Tr,Cr,$r,Br,zr,Fr,Ir,Mr,Ur,Vr,Dr,Hr,Gr,Lr,Wr,Yr,Jr,qr,Kr,Qr,Xr,Zr,rt,tt,nt,et,ot,it,ut,at,ct="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ft(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function st(){if(e)return n;return e=1,n=function(r,t,n){switch(n.length){case 0:return r.call(t);case 1:return r.call(t,n[0]);case 2:return r.call(t,n[0],n[1]);case 3:return r.call(t,n[0],n[1],n[2])}return r.apply(t,n)}}function lt(){if(i)return o;return i=1,o=function(r){return r}}function pt(){if(a)return u;a=1;var r=st(),t=Math.max;return u=function(n,e,o){return e=t(void 0===e?n.length-1:e,0),function(){for(var i=arguments,u=-1,a=t(i.length-e,0),c=Array(a);++u<a;)c[u]=i[e+u];u=-1;for(var f=Array(e+1);++u<e;)f[u]=i[u];return f[e]=o(c),r(n,this,f)}},u}function ht(){if(f)return c;return f=1,c=function(r){return function(){return r}}}function vt(){if(l)return s;l=1;var r="object"==typeof ct&&ct&&ct.Object===Object&&ct;return s=r}function yt(){if(h)return p;h=1;var r=vt(),t="object"==typeof self&&self&&self.Object===Object&&self,n=r||t||Function("return this")();return p=n}function gt(){if(y)return v;y=1;var r=yt().Symbol;return v=r}function dt(){if(d)return g;d=1;var r=gt(),t=Object.prototype,n=t.hasOwnProperty,e=t.toString,o=r?r.toStringTag:void 0;return g=function(r){var t=n.call(r,o),i=r[o];try{r[o]=void 0;var u=!0}catch(r){}var a=e.call(r);return u&&(t?r[o]=i:delete r[o]),a}}function bt(){if(_)return b;_=1;var r=Object.prototype.toString;return b=function(t){return r.call(t)}}function _t(){if(O)return m;O=1;var r=gt(),t=dt(),n=bt(),e=r?r.toStringTag:void 0;return m=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":e&&e in Object(r)?t(r):n(r)}}function mt(){if(w)return j;return w=1,j=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)}}function Ot(){if(k)return R;k=1;var r=_t(),t=mt();return R=function(n){if(!t(n))return!1;var e=r(n);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}}function jt(){if(P)return x;P=1;var r=yt()["__core-js_shared__"];return x=r}function wt(){if(E)return A;E=1;var r,t=jt(),n=(r=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";return A=function(r){return!!n&&n in r}}function Rt(){if(S)return N;S=1;var r=Function.prototype.toString;return N=function(t){if(null!=t){try{return r.call(t)}catch(r){}try{return t+""}catch(r){}}return""}}function kt(){if(C)return T;C=1;var r=Ot(),t=wt(),n=mt(),e=Rt(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,u=Object.prototype,a=i.toString,c=u.hasOwnProperty,f=RegExp("^"+a.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return T=function(i){return!(!n(i)||t(i))&&(r(i)?f:o).test(e(i))}}function xt(){if(B)return $;return B=1,$=function(r,t){return null==r?void 0:r[t]}}function Pt(){if(F)return z;F=1;var r=kt(),t=xt();return z=function(n,e){var o=t(n,e);return r(o)?o:void 0}}function At(){if(M)return I;M=1;var r=Pt(),t=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(r){}}();return I=t}function Et(){if(V)return U;V=1;var r=ht(),t=At();return U=t?function(n,e){return t(n,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:lt()}function Nt(){if(H)return D;H=1;var r=Date.now;return D=function(t){var n=0,e=0;return function(){var o=r(),i=16-(o-e);if(e=o,i>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}},D}function St(){if(L)return G;L=1;var r=Et(),t=Nt()(r);return G=t}function Tt(){if(Y)return W;Y=1;var r=lt(),t=pt(),n=St();return W=function(e,o){return n(t(e,o,r),e+"")}}function Ct(){if(q)return J;return q=1,J=function(){this.__data__=[],this.size=0}}function $t(){if(Q)return K;return Q=1,K=function(r,t){return r===t||r!=r&&t!=t}}function Bt(){if(Z)return X;Z=1;var r=$t();return X=function(t,n){for(var e=t.length;e--;)if(r(t[e][0],n))return e;return-1}}function zt(){if(tr)return rr;tr=1;var r=Bt(),t=Array.prototype.splice;return rr=function(n){var e=this.__data__,o=r(e,n);return!(o<0)&&(o==e.length-1?e.pop():t.call(e,o,1),--this.size,!0)}}function Ft(){if(er)return nr;er=1;var r=Bt();return nr=function(t){var n=this.__data__,e=r(n,t);return e<0?void 0:n[e][1]}}function It(){if(ir)return or;ir=1;var r=Bt();return or=function(t){return r(this.__data__,t)>-1}}function Mt(){if(ar)return ur;ar=1;var r=Bt();return ur=function(t,n){var e=this.__data__,o=r(e,t);return o<0?(++this.size,e.push([t,n])):e[o][1]=n,this}}function Ut(){if(fr)return cr;fr=1;var r=Ct(),t=zt(),n=Ft(),e=It(),o=Mt();function i(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return i.prototype.clear=r,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=e,i.prototype.set=o,cr=i}function Vt(){if(lr)return sr;lr=1;var r=Ut();return sr=function(){this.__data__=new r,this.size=0}}function Dt(){if(hr)return pr;return hr=1,pr=function(r){var t=this.__data__,n=t.delete(r);return this.size=t.size,n}}function Ht(){if(yr)return vr;return yr=1,vr=function(r){return this.__data__.get(r)}}function Gt(){if(dr)return gr;return dr=1,gr=function(r){return this.__data__.has(r)}}function Lt(){if(_r)return br;_r=1;var r=Pt()(yt(),"Map");return br=r}function Wt(){if(Or)return mr;Or=1;var r=Pt()(Object,"create");return mr=r}function Yt(){if(wr)return jr;wr=1;var r=Wt();return jr=function(){this.__data__=r?r(null):{},this.size=0}}function Jt(){if(kr)return Rr;return kr=1,Rr=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}}function qt(){if(Pr)return xr;Pr=1;var r=Wt(),t=Object.prototype.hasOwnProperty;return xr=function(n){var e=this.__data__;if(r){var o=e[n];return"__lodash_hash_undefined__"===o?void 0:o}return t.call(e,n)?e[n]:void 0}}function Kt(){if(Er)return Ar;Er=1;var r=Wt(),t=Object.prototype.hasOwnProperty;return Ar=function(n){var e=this.__data__;return r?void 0!==e[n]:t.call(e,n)}}function Qt(){if(Sr)return Nr;Sr=1;var r=Wt();return Nr=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=r&&void 0===n?"__lodash_hash_undefined__":n,this}}function Xt(){if(Cr)return Tr;Cr=1;var r=Yt(),t=Jt(),n=qt(),e=Kt(),o=Qt();function i(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return i.prototype.clear=r,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=e,i.prototype.set=o,Tr=i}function Zt(){if(Br)return $r;Br=1;var r=Xt(),t=Ut(),n=Lt();return $r=function(){this.size=0,this.__data__={hash:new r,map:new(n||t),string:new r}}}function rn(){if(Fr)return zr;return Fr=1,zr=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r}}function tn(){if(Mr)return Ir;Mr=1;var r=rn();return Ir=function(t,n){var e=t.__data__;return r(n)?e["string"==typeof n?"string":"hash"]:e.map}}function nn(){if(Vr)return Ur;Vr=1;var r=tn();return Ur=function(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}}function en(){if(Hr)return Dr;Hr=1;var r=tn();return Dr=function(t){return r(this,t).get(t)}}function on(){if(Lr)return Gr;Lr=1;var r=tn();return Gr=function(t){return r(this,t).has(t)}}function un(){if(Yr)return Wr;Yr=1;var r=tn();return Wr=function(t,n){var e=r(this,t),o=e.size;return e.set(t,n),this.size+=e.size==o?0:1,this}}function an(){if(qr)return Jr;qr=1;var r=Zt(),t=nn(),n=en(),e=on(),o=un();function i(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return i.prototype.clear=r,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=e,i.prototype.set=o,Jr=i}function cn(){if(Qr)return Kr;Qr=1;var r=Ut(),t=Lt(),n=an();return Kr=function(e,o){var i=this.__data__;if(i instanceof r){var u=i.__data__;if(!t||u.length<199)return u.push([e,o]),this.size=++i.size,this;i=this.__data__=new n(u)}return i.set(e,o),this.size=i.size,this}}function fn(){if(Zr)return Xr;Zr=1;var r=Ut(),t=Vt(),n=Dt(),e=Ht(),o=Gt(),i=cn();function u(t){var n=this.__data__=new r(t);this.size=n.size}return u.prototype.clear=t,u.prototype.delete=n,u.prototype.get=e,u.prototype.has=o,u.prototype.set=i,Xr=u}function sn(){if(tt)return rt;tt=1;var r=At();return rt=function(t,n,e){"__proto__"==n&&r?r(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}}function ln(){if(et)return nt;et=1;var r=sn(),t=$t();return nt=function(n,e,o){(void 0!==o&&!t(n[e],o)||void 0===o&&!(e in n))&&r(n,e,o)}}function pn(){if(it)return ot;return it=1,ot=function(r){return function(t,n,e){for(var o=-1,i=Object(t),u=e(t),a=u.length;a--;){var c=u[r?a:++o];if(!1===n(i[c],c,i))break}return t}}}function hn(){if(at)return ut;at=1;var r=pn()();return ut=r}var vn,yn,gn,dn,bn,_n,mn,On,jn,wn,Rn,kn,xn,Pn,An,En,Nn,Sn,Tn,Cn,$n,Bn,zn,Fn,In,Mn,Un,Vn,Dn,Hn,Gn,Ln,Wn,Yn={exports:{}};function Jn(){return vn||(vn=1,r=Yn,t=Yn.exports,n=yt(),e=t&&!t.nodeType&&t,o=e&&r&&!r.nodeType&&r,i=o&&o.exports===e?n.Buffer:void 0,u=i?i.allocUnsafe:void 0,r.exports=function(r,t){if(t)return r.slice();var n=r.length,e=u?u(n):new r.constructor(n);return r.copy(e),e}),Yn.exports;var r,t,n,e,o,i,u}function qn(){if(gn)return yn;gn=1;var r=yt().Uint8Array;return yn=r}function Kn(){if(bn)return dn;bn=1;var r=qn();return dn=function(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}}function Qn(){if(mn)return _n;mn=1;var r=Kn();return _n=function(t,n){var e=n?r(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}}function Xn(){if(jn)return On;return jn=1,On=function(r,t){var n=-1,e=r.length;for(t||(t=Array(e));++n<e;)t[n]=r[n];return t}}function Zn(){if(Rn)return wn;Rn=1;var r=mt(),t=Object.create,n=function(){function n(){}return function(e){if(!r(e))return{};if(t)return t(e);n.prototype=e;var o=new n;return n.prototype=void 0,o}}();return wn=n}function re(){if(xn)return kn;return xn=1,kn=function(r,t){return function(n){return r(t(n))}}}function te(){if(An)return Pn;An=1;var r=re()(Object.getPrototypeOf,Object);return Pn=r}function ne(){if(Nn)return En;Nn=1;var r=Object.prototype;return En=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||r)}}function ee(){if(Tn)return Sn;Tn=1;var r=Zn(),t=te(),n=ne();return Sn=function(e){return"function"!=typeof e.constructor||n(e)?{}:r(t(e))}}function oe(){if($n)return Cn;return $n=1,Cn=function(r){return null!=r&&"object"==typeof r}}function ie(){if(zn)return Bn;zn=1;var r=_t(),t=oe();return Bn=function(n){return t(n)&&"[object Arguments]"==r(n)}}function ue(){if(In)return Fn;In=1;var r=ie(),t=oe(),n=Object.prototype,e=n.hasOwnProperty,o=n.propertyIsEnumerable,i=r(function(){return arguments}())?r:function(r){return t(r)&&e.call(r,"callee")&&!o.call(r,"callee")};return Fn=i}function ae(){if(Un)return Mn;Un=1;var r=Array.isArray;return Mn=r}function ce(){if(Dn)return Vn;Dn=1;return Vn=function(r){return"number"==typeof r&&r>-1&&r%1==0&&r<=9007199254740991}}function fe(){if(Gn)return Hn;Gn=1;var r=Ot(),t=ce();return Hn=function(n){return null!=n&&t(n.length)&&!r(n)}}function se(){if(Wn)return Ln;Wn=1;var r=fe(),t=oe();return Ln=function(n){return t(n)&&r(n)}}var le,pe,he,ve,ye,ge,de,be,_e,me={exports:{}};function Oe(){if(pe)return le;return pe=1,le=function(){return!1}}function je(){return he||(he=1,function(r,t){var n=yt(),e=Oe(),o=t&&!t.nodeType&&t,i=o&&r&&!r.nodeType&&r,u=i&&i.exports===o?n.Buffer:void 0,a=(u?u.isBuffer:void 0)||e;r.exports=a}(me,me.exports)),me.exports}function we(){if(ye)return ve;ye=1;var r=_t(),t=te(),n=oe(),e=Function.prototype,o=Object.prototype,i=e.toString,u=o.hasOwnProperty,a=i.call(Object);return ve=function(e){if(!n(e)||"[object Object]"!=r(e))return!1;var o=t(e);if(null===o)return!0;var c=u.call(o,"constructor")&&o.constructor;return"function"==typeof c&&c instanceof c&&i.call(c)==a},ve}function Re(){if(de)return ge;de=1;var r=_t(),t=ce(),n=oe(),e={};return e["[object Float32Array]"]=e["[object Float64Array]"]=e["[object Int8Array]"]=e["[object Int16Array]"]=e["[object Int32Array]"]=e["[object Uint8Array]"]=e["[object Uint8ClampedArray]"]=e["[object Uint16Array]"]=e["[object Uint32Array]"]=!0,e["[object Arguments]"]=e["[object Array]"]=e["[object ArrayBuffer]"]=e["[object Boolean]"]=e["[object DataView]"]=e["[object Date]"]=e["[object Error]"]=e["[object Function]"]=e["[object Map]"]=e["[object Number]"]=e["[object Object]"]=e["[object RegExp]"]=e["[object Set]"]=e["[object String]"]=e["[object WeakMap]"]=!1,ge=function(o){return n(o)&&t(o.length)&&!!e[r(o)]}}function ke(){if(_e)return be;return _e=1,be=function(r){return function(t){return r(t)}}}var xe,Pe,Ae,Ee,Ne,Se,Te,Ce,$e,Be,ze,Fe,Ie,Me,Ue,Ve,De,He,Ge,Le,We,Ye,Je,qe,Ke,Qe,Xe,Ze,ro,to,no,eo,oo,io,uo,ao,co,fo={exports:{}};function so(){return xe||(xe=1,r=fo,t=fo.exports,n=vt(),e=t&&!t.nodeType&&t,o=e&&r&&!r.nodeType&&r,i=o&&o.exports===e&&n.process,u=function(){try{var r=o&&o.require&&o.require("util").types;return r||i&&i.binding&&i.binding("util")}catch(r){}}(),r.exports=u),fo.exports;var r,t,n,e,o,i,u}function lo(){if(Ae)return Pe;Ae=1;var r=Re(),t=ke(),n=so(),e=n&&n.isTypedArray,o=e?t(e):r;return Pe=o}function po(){if(Ne)return Ee;return Ne=1,Ee=function(r,t){if(("constructor"!==t||"function"!=typeof r[t])&&"__proto__"!=t)return r[t]}}function ho(){if(Te)return Se;Te=1;var r=sn(),t=$t(),n=Object.prototype.hasOwnProperty;return Se=function(e,o,i){var u=e[o];n.call(e,o)&&t(u,i)&&(void 0!==i||o in e)||r(e,o,i)}}function vo(){if($e)return Ce;$e=1;var r=ho(),t=sn();return Ce=function(n,e,o,i){var u=!o;o||(o={});for(var a=-1,c=e.length;++a<c;){var f=e[a],s=i?i(o[f],n[f],f,o,n):void 0;void 0===s&&(s=n[f]),u?t(o,f,s):r(o,f,s)}return o}}function yo(){if(ze)return Be;return ze=1,Be=function(r,t){for(var n=-1,e=Array(r);++n<r;)e[n]=t(n);return e},Be}function go(){if(Ie)return Fe;Ie=1;var r=/^(?:0|[1-9]\d*)$/;return Fe=function(t,n){var e=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==e||"symbol"!=e&&r.test(t))&&t>-1&&t%1==0&&t<n}}function bo(){if(Ue)return Me;Ue=1;var r=yo(),t=ue(),n=ae(),e=je(),o=go(),i=lo(),u=Object.prototype.hasOwnProperty;return Me=function(a,c){var f=n(a),s=!f&&t(a),l=!f&&!s&&e(a),p=!f&&!s&&!l&&i(a),h=f||s||l||p,v=h?r(a.length,String):[],y=v.length;for(var g in a)!c&&!u.call(a,g)||h&&("length"==g||l&&("offset"==g||"parent"==g)||p&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||o(g,y))||v.push(g);return v}}function _o(){if(De)return Ve;return De=1,Ve=function(r){var t=[];if(null!=r)for(var n in Object(r))t.push(n);return t}}function mo(){if(Ge)return He;Ge=1;var r=mt(),t=ne(),n=_o(),e=Object.prototype.hasOwnProperty;return He=function(o){if(!r(o))return n(o);var i=t(o),u=[];for(var a in o)("constructor"!=a||!i&&e.call(o,a))&&u.push(a);return u}}function Oo(){if(We)return Le;We=1;var r=bo(),t=mo(),n=fe();return Le=function(e){return n(e)?r(e,!0):t(e)}}function jo(){if(Je)return Ye;Je=1;var r=vo(),t=Oo();return Ye=function(n){return r(n,t(n))}}function wo(){if(Ke)return qe;Ke=1;var r=ln(),t=Jn(),n=Qn(),e=Xn(),o=ee(),i=ue(),u=ae(),a=se(),c=je(),f=Ot(),s=mt(),l=we(),p=lo(),h=po(),v=jo();return qe=function(y,g,d,b,_,m,O){var j=h(y,d),w=h(g,d),R=O.get(w);if(R)r(y,d,R);else{var k=m?m(j,w,d+"",y,g,O):void 0,x=void 0===k;if(x){var P=u(w),A=!P&&c(w),E=!P&&!A&&p(w);k=w,P||A||E?u(j)?k=j:a(j)?k=e(j):A?(x=!1,k=t(w,!0)):E?(x=!1,k=n(w,!0)):k=[]:l(w)||i(w)?(k=j,i(j)?k=v(j):s(j)&&!f(j)||(k=o(w))):x=!1}x&&(O.set(w,k),_(k,w,b,m,O),O.delete(w)),r(y,d,k)}}}function Ro(){if(Xe)return Qe;Xe=1;var r=fn(),t=ln(),n=hn(),e=wo(),o=mt(),i=Oo(),u=po();return Qe=function a(c,f,s,l,p){c!==f&&n(f,(function(n,i){if(p||(p=new r),o(n))e(c,f,i,s,a,l,p);else{var h=l?l(u(c,i),n,i+"",c,f,p):void 0;void 0===h&&(h=n),t(c,i,h)}}),i)},Qe}function ko(){if(ro)return Ze;ro=1;var r=Ro(),t=mt();return Ze=function n(e,o,i,u,a,c){return t(e)&&t(o)&&(c.set(o,e),r(e,o,void 0,n,c),c.delete(o)),e},Ze}function xo(){if(no)return to;no=1;var r=$t(),t=fe(),n=go(),e=mt();return to=function(o,i,u){if(!e(u))return!1;var a=typeof i;return!!("number"==a?t(u)&&n(i,u.length):"string"==a&&i in u)&&r(u[i],o)}}function Po(){if(oo)return eo;oo=1;var r=Tt(),t=xo();return eo=function(n){return r((function(r,e){var o=-1,i=e.length,u=i>1?e[i-1]:void 0,a=i>2?e[2]:void 0;for(u=n.length>3&&"function"==typeof u?(i--,u):void 0,a&&t(e[0],e[1],a)&&(u=i<3?void 0:u,i=1),r=Object(r);++o<i;){var c=e[o];c&&n(r,c,o,u)}return r}))}}function Ao(){if(uo)return io;uo=1;var r=Ro(),t=Po()((function(t,n,e,o){r(t,n,e,o)}));return io=t}function Eo(){if(co)return ao;co=1;var r=st(),t=Tt(),n=ko(),e=Ao(),o=t((function(t){return t.push(void 0,n),r(e,void 0,t)}));return ao=o}var No=ft(Eo()),So=ft(we());class To{name;searchPlaces;_config;loaders;searchCache;constructor(r){const{name:t,searchPlaces:n,defaultConfig:e,loaders:o}=r;if(!t&&!n)throw new Error("searchPlaces or name is required");this.name=t,this.searchPlaces=n||function(r){const t=["json","js","ts","cjs","yaml","yml"];return["package.json",...t.map((t=>`${r}.${t}`)),...t.map((t=>`.${r}.${t}`))]}(t),this._config=e||{},this.loaders=o}get config(){return No({},this.search(),this._config)}getSearchPlaces(){return this.searchPlaces}get(t={}){const{file:n,dir:e=process.cwd()}=t,o={};if(!1===n)return o;const i=r(this.name,{searchPlaces:this.searchPlaces,loaders:this.loaders}),u=n?i.load(n):i.search(e);if(u&&"string"==typeof u.config)throw new Error(`Invalid configuration file at ${u.filepath}`);return u&&So(u.config)?u.config:o}search(){return this.searchCache?this.searchCache:this.searchCache=this.get({})}}const Co={protectedBranches:["master","develop","main"],cleanFiles:["dist","node_modules","yarn.lock","package-lock.json",".eslintcache","*.log"],commitlint:{extends:["@commitlint/config-conventional"]},release:{publishPath:"",autoMergeReleasePR:!1,autoMergeType:"squash",branchName:"release-${env}-${branch}-${tagName}",PRTitle:"[${pkgName} Release] Branch:${branch}, Tag:${tagName}, Env:${env}",PRBody:"## Publish Details\n\n- 🏷️ Version: ${tagName}\n- 🌲 Branch: ${branch}\n- 🔧 Environment: ${env}\n\n## Changelog\n\n${changelog}\n\n## Notes\n\n- [ ] Please check if the version number is correct\n- [ ] Please confirm all tests have passed\n- [ ] Please confirm the documentation has been updated\n\n> This PR is auto created by release process, please contact the frontend team if there are any questions.",label:{color:"1A7F37",description:"Release PR",name:"CI-Release"},packagesDirectories:[],changePackagesLabel:"changes:${name}"},envOrder:[".env.local",".env.production",".env"]};var $o,Bo,zo,Fo,Io,Mo,Uo,Vo,Do,Ho,Go,Lo,Wo,Yo,Jo,qo,Ko,Qo,Xo,Zo,ri,ti,ni,ei,oi,ii,ui,ai,ci,fi,si,li,pi,hi,vi,yi,gi,di,bi,_i,mi,Oi;function ji(){if(Bo)return $o;Bo=1;var r=vo(),t=Po(),n=Oo(),e=t((function(t,e,o,i){r(e,n(e),t,i)}));return $o=e}function wi(){if(Fo)return zo;Fo=1;var r=_t(),t=oe(),n=we();return zo=function(e){if(!t(e))return!1;var o=r(e);return"[object Error]"==o||"[object DOMException]"==o||"string"==typeof e.message&&"string"==typeof e.name&&!n(e)}}function Ri(){if(Mo)return Io;Mo=1;var r=st(),t=Tt(),n=wi(),e=t((function(t,e){try{return r(t,void 0,e)}catch(r){return n(r)?r:new Error(r)}}));return Io=e}function ki(){if(Vo)return Uo;return Vo=1,Uo=function(r,t){for(var n=-1,e=null==r?0:r.length,o=Array(e);++n<e;)o[n]=t(r[n],n,r);return o}}function xi(){if(Ho)return Do;Ho=1;var r=ki();return Do=function(t,n){return r(n,(function(r){return t[r]}))}}function Pi(){if(Lo)return Go;Lo=1;var r=$t(),t=Object.prototype,n=t.hasOwnProperty;return Go=function(e,o,i,u){return void 0===e||r(e,t[i])&&!n.call(u,i)?o:e}}function Ai(){if(Yo)return Wo;Yo=1;var r={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};return Wo=function(t){return"\\"+r[t]}}function Ei(){if(qo)return Jo;qo=1;var r=re()(Object.keys,Object);return Jo=r}function Ni(){if(Qo)return Ko;Qo=1;var r=ne(),t=Ei(),n=Object.prototype.hasOwnProperty;return Ko=function(e){if(!r(e))return t(e);var o=[];for(var i in Object(e))n.call(e,i)&&"constructor"!=i&&o.push(i);return o}}function Si(){if(Zo)return Xo;Zo=1;var r=bo(),t=Ni(),n=fe();return Xo=function(e){return n(e)?r(e):t(e)}}function Ti(){if(ti)return ri;ti=1;return ri=/<%=([\s\S]+?)%>/g}function Ci(){if(ei)return ni;return ei=1,ni=function(r){return function(t){return null==r?void 0:r[t]}}}function $i(){if(ii)return oi;ii=1;var r=Ci()({"&":"&","<":"<",">":">",'"':""","'":"'"});return oi=r}function Bi(){if(ai)return ui;ai=1;var r=_t(),t=oe();return ui=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==r(n)}}function zi(){if(fi)return ci;fi=1;var r=gt(),t=ki(),n=ae(),e=Bi(),o=r?r.prototype:void 0,i=o?o.toString:void 0;return ci=function r(o){if("string"==typeof o)return o;if(n(o))return t(o,r)+"";if(e(o))return i?i.call(o):"";var u=o+"";return"0"==u&&1/o==-1/0?"-0":u},ci}function Fi(){if(li)return si;li=1;var r=zi();return si=function(t){return null==t?"":r(t)}}function Ii(){if(hi)return pi;hi=1;var r=$i(),t=Fi(),n=/[&<>"']/g,e=RegExp(n.source);return pi=function(o){return(o=t(o))&&e.test(o)?o.replace(n,r):o}}function Mi(){if(yi)return vi;yi=1;return vi=/<%-([\s\S]+?)%>/g}function Ui(){if(di)return gi;di=1;return gi=/<%([\s\S]+?)%>/g}function Vi(){if(_i)return bi;_i=1;var r=Ii();return bi={escape:Mi(),evaluate:Ui(),interpolate:Ti(),variable:"",imports:{_:{escape:r}}}}function Di(){if(Oi)return mi;Oi=1;var r=ji(),t=Ri(),n=xi(),e=Pi(),o=Ai(),i=wi(),u=xo(),a=Si(),c=Ti(),f=Vi(),s=Fi(),l=/\b__p \+= '';/g,p=/\b(__p \+=) '' \+/g,h=/(__e\(.*?\)|\b__t\)) \+\n'';/g,v=/[()=,{}\[\]\/\s]/,y=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,g=/($^)/,d=/['\n\r\u2028\u2029\\]/g,b=Object.prototype.hasOwnProperty;return mi=function(_,m,O){var j=f.imports._.templateSettings||f;O&&u(_,m,O)&&(m=void 0),_=s(_),m=r({},m,j,e);var w,R,k=r({},m.imports,j.imports,e),x=a(k),P=n(k,x),A=0,E=m.interpolate||g,N="__p += '",S=RegExp((m.escape||g).source+"|"+E.source+"|"+(E===c?y:g).source+"|"+(m.evaluate||g).source+"|$","g"),T=b.call(m,"sourceURL")?"//# sourceURL="+(m.sourceURL+"").replace(/\s/g," ")+"\n":"";_.replace(S,(function(r,t,n,e,i,u){return n||(n=e),N+=_.slice(A,u).replace(d,o),t&&(w=!0,N+="' +\n__e("+t+") +\n'"),i&&(R=!0,N+="';\n"+i+";\n__p += '"),n&&(N+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),A=u+r.length,r})),N+="';\n";var C=b.call(m,"variable")&&m.variable;if(C){if(v.test(C))throw new Error("Invalid `variable` option passed into `_.template`")}else N="with (obj) {\n"+N+"\n}\n";N=(R?N.replace(l,""):N).replace(p,"$1").replace(h,"$1;"),N="function("+(C||"obj")+") {\n"+(C?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(w?", __e = _.escape":"")+(R?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+N+"return __p\n}";var $=t((function(){return Function(x,T+"return "+N).apply(void 0,P)}));if($.source=N,i($))throw $;return $}}var Hi,Gi,Li=ft(Di());class Wi{config;cache;constructor(r,t=new Map){this.config=r,this.cache=t}get logger(){return this.config.logger}static format(r="",t={}){return Li(r)(t)}format(r="",t={}){try{return Wi.format(r,t)}catch(n){throw this.logger.error(`Unable to render template with context:\n${r}\n${JSON.stringify(t)}`),this.logger.error(n),n}}exec(r,t={}){const{context:n,...e}=t;return"string"==typeof r?this.execFormattedCommand(this.format(r,n||{}),e):this.execFormattedCommand(r,e)}run(r,t={}){return this.exec(r,{silent:!0,...t})}async execFormattedCommand(r,t={}){const n=this.config.execPromise;if(!n)throw new Error("execPromise is not defined");const{dryRunResult:e,silent:o,dryRun:i}=t,u=void 0!==i?i:this.config.dryRun,a="string"==typeof r?r:r.join(" "),c=this.cache.has(a);if(o||this.logger.exec(r,{isCached:c}),u)return Promise.resolve(e);if(c)return this.cache.get(a);const f=n(r,t);return this.cache.has(a)||this.cache.set(a,f),f}}function Yi(){if(Gi)return Hi;Gi=1;var r=Ro(),t=Po()((function(t,n,e){r(t,n,e)}));return Hi=t}var Ji=ft(Yi()),qi=function(){function r(r){void 0===r&&(r={}),this.config=r,this.plugins=[]}return r.prototype.use=function(r){this.plugins.find((function(t){return t===r||t.pluginName===r.pluginName||t.constructor===r.constructor}))&&r.onlyOne?console.warn("Plugin ".concat(r.pluginName," is already used, skip adding")):this.plugins.push(r)},r}(),Ki=function(r,t){return Ki=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])},Ki(r,t)};function Qi(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=r}Ki(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Xi(r,t,n,e){return new(n||(n=Promise))((function(t,o){function i(r){try{a(e.next(r))}catch(r){o(r)}}function u(r){try{a(e.throw(r))}catch(r){o(r)}}function a(r){var e;r.done?t(r.value):(e=r.value,e instanceof n?e:new n((function(r){r(e)}))).then(i,u)}a((e=e.apply(r,[])).next())}))}function Zi(r,t){var n,e,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=a(0),u.throw=a(1),u.return=a(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(i=0)),i;)try{if(n=1,e&&(o=2&a[0]?e.return:a[0]?e.throw||((o=e.return)&&o.call(e),0):e.next)&&!(o=o.call(e,a[1])).done)return o;switch(e=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,e=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(r,i)}catch(r){a=[6,r],e=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function ru(r,t,n){if(2===arguments.length)for(var e,o=0,i=t.length;o<i;o++)!e&&o in t||(e||(e=Array.prototype.slice.call(t,0,o)),e[o]=t[o]);return r.concat(e||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var tu,nu,eu,ou,iu,uu=function(r){function t(t,n){var e=this.constructor,o=r.call(this,n instanceof Error?n.message:n||t)||this;return o.id=t,n instanceof Error&&"stack"in n&&(o.stack=n.stack),Object.setPrototypeOf(o,e.prototype),o}return Qi(t,r),t}(Error);!function(r){function t(){return null!==r&&r.apply(this,arguments)||this}Qi(t,r)}(uu),function(r){r.REQUEST_ERROR="REQUEST_ERROR",r.ENV_FETCH_NOT_SUPPORT="ENV_FETCH_NOT_SUPPORT",r.FETCHER_NONE="FETCHER_NONE",r.RESPONSE_NOT_OK="RESPONSE_NOT_OK",r.ABORT_ERROR="ABORT_ERROR",r.URL_NONE="URL_NONE"}(tu||(tu={})),function(r){function t(){return null!==r&&r.apply(this,arguments)||this}Qi(t,r),t.prototype.runHooks=function(r,t,n){for(var e=[],o=3;o<arguments.length;o++)e[o-3]=arguments[o];return Xi(this,0,void 0,(function(){var o,i,u,a,c,f,s,l;return Zi(this,(function(p){switch(p.label){case 0:o=-1,(u=n||{parameters:void 0,hooksRuntimes:{}}).hooksRuntimes.times=0,u.hooksRuntimes.index=void 0,a=0,c=r,p.label=1;case 1:return a<c.length?(f=c[a],o++,"function"!=typeof f[t]||"function"==typeof f.enabled&&!f.enabled(t,n)?[3,3]:(null===(l=u.hooksRuntimes)||void 0===l?void 0:l.breakChain)?[3,4]:(u.hooksRuntimes.pluginName=f.pluginName,u.hooksRuntimes.hookName=t,u.hooksRuntimes.times++,u.hooksRuntimes.index=o,[4,f[t].apply(f,ru([n],e,!1))])):[3,4];case 2:if(void 0!==(s=p.sent())&&(i=s,u.hooksRuntimes.returnValue=s,u.hooksRuntimes.returnBreakChain))return[2,i];p.label=3;case 3:return a++,[3,1];case 4:return[2,i]}}))}))},t.prototype.execNoError=function(r,t){return Xi(this,0,void 0,(function(){var n;return Zi(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.exec(r,t)];case 1:return[2,e.sent()];case 2:return(n=e.sent())instanceof uu?[2,n]:[2,new uu("UNKNOWN_ASYNC_ERROR",n)];case 3:return[2]}}))}))},t.prototype.exec=function(r,t){var n=t||r,e=t?r:void 0;if("function"!=typeof n)throw new Error("Task must be a async function!");return this.run(e,n)},t.prototype.run=function(r,t){return Xi(this,0,void 0,(function(){var n,e,o,i=this;return Zi(this,(function(u){switch(u.label){case 0:n={parameters:r,returnValue:void 0,error:void 0,hooksRuntimes:{pluginName:"",hookName:"",returnValue:void 0,returnBreakChain:!1,times:0}},e=function(r){return Xi(i,0,void 0,(function(){var n;return Zi(this,(function(e){switch(e.label){case 0:return[4,this.runHooks(this.plugins,"onExec",r,t)];case 1:return e.sent(),0!==r.hooksRuntimes.times?[3,3]:(n=r,[4,t(r)]);case 2:return n.returnValue=e.sent(),[2];case 3:return r.returnValue=r.hooksRuntimes.returnValue,[2]}}))}))},u.label=1;case 1:return u.trys.push([1,5,7,8]),[4,this.runHooks(this.plugins,"onBefore",n)];case 2:return u.sent(),[4,e(n)];case 3:return u.sent(),[4,this.runHooks(this.plugins,"onSuccess",n)];case 4:return u.sent(),[2,n.returnValue];case 5:return o=u.sent(),n.error=o,Object.assign(n.hooksRuntimes,{returnBreakChain:!0}),[4,this.runHooks(this.plugins,"onError",n)];case 6:if(u.sent(),n.hooksRuntimes.returnValue&&(n.error=n.hooksRuntimes.returnValue),n.error instanceof uu)throw n.error;throw new uu("UNKNOWN_ASYNC_ERROR",n.error);case 7:return n.hooksRuntimes={pluginName:"",hookName:"",returnValue:void 0,returnBreakChain:!1,times:0},[7];case 8:return[2]}}))}))}}(qi),function(r){function t(){return null!==r&&r.apply(this,arguments)||this}Qi(t,r),t.prototype.runHooks=function(r,t,n){for(var e,o=[],i=3;i<arguments.length;i++)o[i-3]=arguments[i];var u,a=-1,c=n||{parameters:void 0,hooksRuntimes:{}};c.hooksRuntimes.times=0,c.hooksRuntimes.index=void 0;for(var f=0,s=r;f<s.length;f++){var l=s[f];if(a++,"function"==typeof l[t]&&("function"!=typeof l.enabled||l.enabled(t,c))){if(null===(e=c.hooksRuntimes)||void 0===e?void 0:e.breakChain)break;c.hooksRuntimes.pluginName=l.pluginName,c.hooksRuntimes.hookName=t,c.hooksRuntimes.times++,c.hooksRuntimes.index=a;var p=l[t].apply(l,ru([n],o,!1));if(void 0!==p&&(u=p,c.hooksRuntimes.returnValue=p,c.hooksRuntimes.returnBreakChain))return u}}return u},t.prototype.execNoError=function(r,t){try{return this.exec(r,t)}catch(r){return r instanceof uu?r:new uu("UNKNOWN_SYNC_ERROR",r)}},t.prototype.exec=function(r,t){var n=t||r,e=t?r:void 0;if("function"!=typeof n)throw new Error("Task must be a function!");return this.run(e,n)},t.prototype.run=function(r,t){var n,e={parameters:r,returnValue:void 0,error:void 0,hooksRuntimes:{pluginName:"",hookName:"",returnValue:void 0,returnBreakChain:!1,times:0}};try{return this.runHooks(this.plugins,"onBefore",e),n=e,this.runHooks(this.plugins,"onExec",n,t),n.returnValue=n.hooksRuntimes.times?n.hooksRuntimes.returnValue:t(n),this.runHooks(this.plugins,"onSuccess",e),e.returnValue}catch(r){if(e.error=r,Object.assign(e.hooksRuntimes,{returnBreakChain:!0}),this.runHooks(this.plugins,"onError",e),e.hooksRuntimes.returnValue&&(e.error=e.hooksRuntimes.returnValue),e.error instanceof uu)throw e.error;throw new uu("UNKNOWN_SYNC_ERROR",e.error)}finally{e.hooksRuntimes={pluginName:"",hookName:"",returnValue:void 0,returnBreakChain:!1,times:0}}}}(qi);var au="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function cu(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var fu,su,lu,pu,hu,vu,yu,gu,du,bu,_u,mu,Ou,ju,wu,Ru,ku,xu,Pu,Au,Eu,Nu,Su=cu(iu?ou:(iu=1,ou=eu?nu:(eu=1,nu=function(r){return r&&r.length?r[0]:void 0}))),Tu=cu(su?fu:(su=1,fu=function(r){var t=null==r?0:r.length;return t?r[t-1]:void 0}));function Cu(){if(vu)return hu;vu=1;var r=function(){if(pu)return lu;pu=1;var r="object"==typeof au&&au&&au.Object===Object&&au;return lu=r}(),t="object"==typeof self&&self&&self.Object===Object&&self,n=r||t||Function("return this")();return hu=n}function $u(){if(gu)return yu;gu=1;var r=Cu().Symbol;return yu=r}function Bu(){if(ju)return Ou;ju=1;var r=$u(),t=function(){if(bu)return du;bu=1;var r=$u(),t=Object.prototype,n=t.hasOwnProperty,e=t.toString,o=r?r.toStringTag:void 0;return du=function(r){var t=n.call(r,o),i=r[o];try{r[o]=void 0;var u=!0}catch(r){}var a=e.call(r);return u&&(t?r[o]=i:delete r[o]),a}}(),n=function(){if(mu)return _u;mu=1;var r=Object.prototype.toString;return _u=function(t){return r.call(t)}}(),e=r?r.toStringTag:void 0;return Ou=function(r){return null==r?void 0===r?"[object Undefined]":"[object Null]":e&&e in Object(r)?t(r):n(r)}}function zu(){return Au?Pu:(Au=1,Pu=function(r){return null!=r&&"object"==typeof r})}var Fu,Iu,Mu,Uu,Vu=cu(function(){if(Nu)return Eu;Nu=1;var r=Bu(),t=function(){if(xu)return ku;xu=1;var r=(Ru?wu:(Ru=1,wu=function(r,t){return function(n){return r(t(n))}}))(Object.getPrototypeOf,Object);return ku=r}(),n=zu(),e=Function.prototype,o=Object.prototype,i=e.toString,u=o.hasOwnProperty,a=i.call(Object);return Eu=function(e){if(!n(e)||"[object Object]"!=r(e))return!1;var o=t(e);if(null===o)return!0;var c=u.call(o,"constructor")&&o.constructor;return"function"==typeof c&&c instanceof c&&i.call(c)==a}}());function Du(){if(Iu)return Fu;Iu=1;var r=Array.isArray;return Fu=r}var Hu,Gu,Lu=function(){if(Uu)return Mu;Uu=1;var r=Bu(),t=Du(),n=zu();return Mu=function(e){return"string"==typeof e||!t(e)&&n(e)&&"[object String]"==r(e)}}(),Wu=cu(Lu),Yu=cu(Du());function Ju(){return Gu?Hu:(Gu=1,Hu=function(r){var t=typeof r;return null!=r&&("object"==t||"function"==t)})}var qu,Ku,Qu,Xu,Zu,ra,ta,na,ea,oa,ia,ua,aa,ca,fa,sa,la,pa,ha,va,ya,ga,da,ba,_a,ma,Oa,ja,wa,Ra,ka,xa,Pa,Aa,Ea,Na,Sa,Ta,Ca,$a,Ba,za,Fa,Ia,Ma,Ua,Va,Da,Ha,Ga,La,Wa,Ya,Ja,qa,Ka,Qa,Xa,Za,rc,tc,nc,ec,oc,ic,uc,ac,cc,fc,sc,lc,pc,hc,vc,yc,gc,dc,bc,_c,mc,Oc,jc,wc,Rc,kc,xc,Pc,Ac,Ec,Nc,Sc,Tc,Cc,$c,Bc,zc,Fc,Ic,Mc,Uc,Vc,Dc,Hc,Gc,Lc,Wc,Yc,Jc,qc,Kc,Qc,Xc,Zc,rf,tf,nf,ef,of,uf,af,cf,ff,sf,lf,pf,hf,vf,yf,gf,df,bf,_f,mf,Of,jf,wf,Rf,kf=cu(Ju()),xf="LOG",Pf="INFO",Af="ERROR",Ef="WARN",Nf="DEBUG",Sf=function(){function r(r){var t=void 0===r?{}:r,n=t.isCI,e=void 0!==n&&n,o=t.dryRun,i=void 0!==o&&o,u=t.debug,a=void 0!==u&&u,c=t.silent,f=void 0!==c&&c;this.isCI=e,this.isDryRun=i,this.isDebug=a,this.isSilent=f}return r.prototype.print=function(r){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.isSilent||console.log.apply(console,t)},r.prototype.prefix=function(r,t){return r},r.prototype.log=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this.print.apply(this,ru([xf],r,!1))},r.prototype.info=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this.print.apply(this,ru([Pf,this.prefix(Pf)],r,!1))},r.prototype.warn=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this.print.apply(this,ru([Ef,this.prefix(Ef)],r,!1))},r.prototype.error=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this.print.apply(this,ru([Af,this.prefix(Af)],r,!1))},r.prototype.debug=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];if(this.isDebug){var n=Su(r),e=kf(n)?JSON.stringify(n):String(n);this.print.apply(this,ru([Nf,this.prefix(Nf),e],r.slice(1),!1))}},r.prototype.verbose=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this.isDebug&&this.print.apply(this,ru([Nf],r,!1))},r.prototype.exec=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=Vu(Tu(r))?Tu(r):void 0,e=n||{},o=e.isDryRun,i=e.isExternal;if(o||this.isDryRun){var u=[null==i?"$":"!",r.slice(0,null==n?void 0:-1).map((function(r){return Wu(r)?r:Yu(r)?r.join(" "):String(r)})).join(" ")].join(" ").trim();this.log(u)}},r.prototype.obtrusive=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this.isCI||this.log(),this.log.apply(this,r),this.isCI||this.log()},r}(),Tf={exports:{}},Cf=(qu||(qu=1,function(r,t){function n(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return e.apply(void 0,r)}function e(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return c(!0===r[0],!1,r)}function o(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return c(!0===r[0],!0,r)}function i(r){if(Array.isArray(r)){for(var t=[],n=0;n<r.length;++n)t.push(i(r[n]));return t}if(u(r)){for(var n in t={},r)t[n]=i(r[n]);return t}return r}function u(r){return r&&"object"==typeof r&&!Array.isArray(r)}function a(r,t){if(!u(r))return t;for(var n in t)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&(r[n]=u(r[n])&&u(t[n])?a(r[n],t[n]):t[n]);return r}function c(r,t,n){var e;!r&&u(e=n.shift())||(e={});for(var o=0;o<n.length;++o){var c=n[o];if(u(c))for(var f in c)if("__proto__"!==f&&"constructor"!==f&&"prototype"!==f){var s=r?i(c[f]):c[f];e[f]=t?a(e[f],s):s}}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.isPlainObject=t.clone=t.recursive=t.merge=t.main=void 0,r.exports=t=n,t.default=n,t.main=n,n.clone=i,n.isPlainObject=u,n.recursive=o,t.merge=e,t.recursive=o,t.clone=i,t.isPlainObject=u}(Tf,Tf.exports)),Tf.exports);function $f(){if(Qu)return Ku;Qu=1;var r=Bu(),t=zu();return Ku=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==r(n)}}function Bf(){if(fa)return ca;fa=1;var r=function(){if(ta)return ra;ta=1;var r=Bu(),t=Ju();return ra=function(n){if(!t(n))return!1;var e=r(n);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}}(),t=function(){if(ia)return oa;ia=1;var r,t=function(){if(ea)return na;ea=1;var r=Cu()["__core-js_shared__"];return na=r}(),n=(r=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";return oa=function(r){return!!n&&n in r}}(),n=Ju(),e=function(){if(aa)return ua;aa=1;var r=Function.prototype.toString;return ua=function(t){if(null!=t){try{return r.call(t)}catch(r){}try{return t+""}catch(r){}}return""}}(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,u=Object.prototype,a=i.toString,c=u.hasOwnProperty,f=RegExp("^"+a.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return ca=function(i){return!(!n(i)||t(i))&&(r(i)?f:o).test(e(i))}}function zf(){if(ha)return pa;ha=1;var r=Bf(),t=la?sa:(la=1,sa=function(r,t){return null==r?void 0:r[t]});return pa=function(n,e){var o=t(n,e);return r(o)?o:void 0}}function Ff(){if(ya)return va;ya=1;var r=zf()(Object,"create");return va=r}function If(){return Sa?Na:(Sa=1,Na=function(r,t){return r===t||r!=r&&t!=t})}function Mf(){if(Ca)return Ta;Ca=1;var r=If();return Ta=function(t,n){for(var e=t.length;e--;)if(r(t[e][0],n))return e;return-1}}function Uf(){if(Ya)return Wa;Ya=1;var r=function(){if(Pa)return xa;Pa=1;var r=function(){if(da)return ga;da=1;var r=Ff();return ga=function(){this.__data__=r?r(null):{},this.size=0}}(),t=_a?ba:(_a=1,ba=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}),n=function(){if(Oa)return ma;Oa=1;var r=Ff(),t=Object.prototype.hasOwnProperty;return ma=function(n){var e=this.__data__;if(r){var o=e[n];return"__lodash_hash_undefined__"===o?void 0:o}return t.call(e,n)?e[n]:void 0}}(),e=function(){if(wa)return ja;wa=1;var r=Ff(),t=Object.prototype.hasOwnProperty;return ja=function(n){var e=this.__data__;return r?void 0!==e[n]:t.call(e,n)}}(),o=function(){if(ka)return Ra;ka=1;var r=Ff();return Ra=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=r&&void 0===n?"__lodash_hash_undefined__":n,this}}();function i(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return i.prototype.clear=r,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=e,i.prototype.set=o,xa=i}(),t=function(){if(Ha)return Da;Ha=1;var r=Ea?Aa:(Ea=1,Aa=function(){this.__data__=[],this.size=0}),t=function(){if(Ba)return $a;Ba=1;var r=Mf(),t=Array.prototype.splice;return $a=function(n){var e=this.__data__,o=r(e,n);return!(o<0||(o==e.length-1?e.pop():t.call(e,o,1),--this.size,0))}}(),n=function(){if(Fa)return za;Fa=1;var r=Mf();return za=function(t){var n=this.__data__,e=r(n,t);return e<0?void 0:n[e][1]}}(),e=function(){if(Ma)return Ia;Ma=1;var r=Mf();return Ia=function(t){return r(this.__data__,t)>-1}}(),o=function(){if(Va)return Ua;Va=1;var r=Mf();return Ua=function(t,n){var e=this.__data__,o=r(e,t);return o<0?(++this.size,e.push([t,n])):e[o][1]=n,this}}();function i(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return i.prototype.clear=r,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=e,i.prototype.set=o,Da=i}(),n=function(){if(La)return Ga;La=1;var r=zf()(Cu(),"Map");return Ga=r}();return Wa=function(){this.size=0,this.__data__={hash:new r,map:new(n||t),string:new r}}}function Vf(){if(Qa)return Ka;Qa=1;var r=qa?Ja:(qa=1,Ja=function(r){var t=typeof r;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r});return Ka=function(t,n){var e=t.__data__;return r(n)?e["string"==typeof n?"string":"hash"]:e.map}}function Df(){if(lc)return sc;lc=1;var r=function(){if(fc)return cc;fc=1;var r=function(){if(ac)return uc;ac=1;var r=Uf(),t=function(){if(Za)return Xa;Za=1;var r=Vf();return Xa=function(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}}(),n=function(){if(tc)return rc;tc=1;var r=Vf();return rc=function(t){return r(this,t).get(t)}}(),e=function(){if(ec)return nc;ec=1;var r=Vf();return nc=function(t){return r(this,t).has(t)}}(),o=function(){if(ic)return oc;ic=1;var r=Vf();return oc=function(t,n){var e=r(this,t),o=e.size;return e.set(t,n),this.size+=e.size==o?0:1,this}}();function i(r){var t=-1,n=null==r?0:r.length;for(this.clear();++t<n;){var e=r[t];this.set(e[0],e[1])}}return i.prototype.clear=r,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=e,i.prototype.set=o,uc=i}();function t(n,e){if("function"!=typeof n||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var o=function(){var r=arguments,t=e?e.apply(this,r):r[0],i=o.cache;if(i.has(t))return i.get(t);var u=n.apply(this,r);return o.cache=i.set(t,u)||i,u};return o.cache=new(t.Cache||r),o}return t.Cache=r,cc=t}();return sc=function(t){var n=r(t,(function(r){return 500===e.size&&e.clear(),r})),e=n.cache;return n}}function Hf(){if(Oc)return mc;Oc=1;var r=Du(),t=function(){if(Zu)return Xu;Zu=1;var r=Du(),t=$f(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,e=/^\w*$/;return Xu=function(o,i){if(r(o))return!1;var u=typeof o;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=o&&!t(o))||e.test(o)||!n.test(o)||null!=i&&o in Object(i)}}(),n=function(){if(hc)return pc;hc=1;var r=Df(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,e=r((function(r){var e=[];return 46===r.charCodeAt(0)&&e.push(""),r.replace(t,(function(r,t,o,i){e.push(o?i.replace(n,"$1"):t||r)})),e}));return pc=e}(),e=function(){if(_c)return bc;_c=1;var r=function(){if(dc)return gc;dc=1;var r=$u(),t=yc?vc:(yc=1,vc=function(r,t){for(var n=-1,e=null==r?0:r.length,o=Array(e);++n<e;)o[n]=t(r[n],n,r);return o}),n=Du(),e=$f(),o=r?r.prototype:void 0,i=o?o.toString:void 0;return gc=function r(o){if("string"==typeof o)return o;if(n(o))return t(o,r)+"";if(e(o))return i?i.call(o):"";var u=o+"";return"0"==u&&1/o==-1/0?"-0":u},gc}();return bc=function(t){return null==t?"":r(t)}}();return mc=function(o,i){return r(o)?o:t(o,i)?[o]:n(e(o))}}function Gf(){if(wc)return jc;wc=1;var r=$f();return jc=function(t){if("string"==typeof t||r(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}}function Lf(){if(Pc)return xc;Pc=1;var r=zf(),t=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(r){}}();return xc=t}function Wf(){if(Cc)return Tc;Cc=1;var r=/^(?:0|[1-9]\d*)$/;return Tc=function(t,n){var e=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==e||"symbol"!=e&&r.test(t))&&t>-1&&t%1==0&&t<n}}function Yf(){if(Fc)return zc;Fc=1;var r=function(){if(kc)return Rc;kc=1;var r=Hf(),t=Gf();return Rc=function(n,e){for(var o=0,i=(e=r(e,n)).length;null!=n&&o<i;)n=n[t(e[o++])];return o&&o==i?n:void 0}}(),t=function(){if(Bc)return $c;Bc=1;var r=function(){if(Sc)return Nc;Sc=1;var r=function(){if(Ec)return Ac;Ec=1;var r=Lf();return Ac=function(t,n,e){"__proto__"==n&&r?r(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}}(),t=If(),n=Object.prototype.hasOwnProperty;return Nc=function(e,o,i){var u=e[o];n.call(e,o)&&t(u,i)&&(void 0!==i||o in e)||r(e,o,i)}}(),t=Hf(),n=Wf(),e=Ju(),o=Gf();return $c=function(i,u,a,c){if(!e(i))return i;for(var f=-1,s=(u=t(u,i)).length,l=s-1,p=i;null!=p&&++f<s;){var h=o(u[f]),v=a;if("__proto__"===h||"constructor"===h||"prototype"===h)return i;if(f!=l){var y=p[h];void 0===(v=c?c(y,h,p):void 0)&&(v=e(y)?y:n(u[f+1])?[]:{})}r(p,h,v),p=p[h]}return i}}(),n=Hf();return zc=function(e,o,i){for(var u=-1,a=o.length,c={};++u<a;){var f=o[u],s=r(e,f);i(s,f)&&t(c,n(f,e),s)}return c}}function Jf(){if(Hc)return Dc;Hc=1;var r=function(){if(Vc)return Uc;Vc=1;var r=Bu(),t=zu();return Uc=function(n){return t(n)&&"[object Arguments]"==r(n)}}(),t=zu(),n=Object.prototype,e=n.hasOwnProperty,o=n.propertyIsEnumerable,i=r(function(){return arguments}())?r:function(r){return t(r)&&e.call(r,"callee")&&!o.call(r,"callee")};return Dc=i}function qf(){if(qc)return Jc;qc=1;var r=Mc?Ic:(Mc=1,Ic=function(r,t){return null!=r&&t in Object(r)}),t=function(){if(Yc)return Wc;Yc=1;var r=Hf(),t=Jf(),n=Du(),e=Wf(),o=Lc?Gc:(Lc=1,Gc=function(r){return"number"==typeof r&&r>-1&&r%1==0&&r<=9007199254740991}),i=Gf();return Wc=function(u,a,c){for(var f=-1,s=(a=r(a,u)).length,l=!1;++f<s;){var p=i(a[f]);if(!(l=null!=u&&c(u,p)))break;u=u[p]}return l||++f!=s?l:!!(s=null==u?0:u.length)&&o(s)&&e(p,s)&&(n(u)||t(u))}}();return Jc=function(n,e){return null!=n&&t(n,e,r)}}function Kf(){if(mf)return _f;mf=1;var r=function(){if(gf)return yf;gf=1;var r=pf?lf:(pf=1,lf=function(r){return function(){return r}}),t=Lf(),n=vf?hf:(vf=1,hf=function(r){return r});return yf=t?function(n,e){return t(n,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:n}(),t=function(){if(bf)return df;bf=1;var r=Date.now;return df=function(t){var n=0,e=0;return function(){var o=r(),i=16-(o-e);if(e=o,i>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}},df}(),n=t(r);return _f=n}function Qf(){if(jf)return Of;jf=1;var r=function(){if(uf)return of;uf=1;var r=function(){if(ef)return nf;ef=1;var r=Zc?Xc:(Zc=1,Xc=function(r,t){for(var n=-1,e=t.length,o=r.length;++n<e;)r[o+n]=t[n];return r}),t=function(){if(tf)return rf;tf=1;var r=$u(),t=Jf(),n=Du(),e=r?r.isConcatSpreadable:void 0;return rf=function(r){return n(r)||t(r)||!!(e&&r&&r[e])}}();return nf=function n(e,o,i,u,a){var c=-1,f=e.length;for(i||(i=t),a||(a=[]);++c<f;){var s=e[c];o>0&&i(s)?o>1?n(s,o-1,i,u,a):r(a,s):u||(a[a.length]=s)}return a},nf}();return of=function(t){return null!=t&&t.length?r(t,1):[]}}(),t=function(){if(sf)return ff;sf=1;var r=cf?af:(cf=1,af=function(r,t,n){switch(n.length){case 0:return r.call(t);case 1:return r.call(t,n[0]);case 2:return r.call(t,n[0],n[1]);case 3:return r.call(t,n[0],n[1],n[2])}return r.apply(t,n)}),t=Math.max;return ff=function(n,e,o){return e=t(void 0===e?n.length-1:e,0),function(){for(var i=arguments,u=-1,a=t(i.length-e,0),c=Array(a);++u<a;)c[u]=i[e+u];u=-1;for(var f=Array(e+1);++u<e;)f[u]=i[u];return f[e]=o(c),r(n,this,f)}},ff}(),n=Kf();return Of=function(e){return n(t(e,void 0,r),e+"")}}cu(Cf);var Xf,Zf=function(){if(Rf)return wf;Rf=1;var r=function(){if(Qc)return Kc;Qc=1;var r=Yf(),t=qf();return Kc=function(n,e){return r(n,e,(function(r,e){return t(n,e)}))}}(),t=Qf()((function(t,n){return null==t?{}:r(t,n)}));return wf=t}();cu(Zf);var rs=function(){function r(r){void 0===r&&(r={}),this.options=r,this[Xf]="JSONSerializer"}return r.prototype.createReplacer=function(r){return Array.isArray(r)?r:null===r?function(r,t){return"string"==typeof t?t.replace(/\r\n/g,"\n"):t}:"function"==typeof r?function(t,n){var e="string"==typeof n?n.replace(/\r\n/g,"\n"):n;return r.call(this,t,e)}:function(r,t){return"string"==typeof t?t.replace(/\r\n/g,"\n"):t}},r.prototype.stringify=function(r,t,n){try{var e=this.createReplacer(t);return Array.isArray(e)?JSON.stringify(r,e,n):JSON.stringify(r,e,null!=n?n:this.options.pretty?this.options.indent||2:void 0)}catch(r){if(r instanceof TypeError&&r.message.includes("circular"))throw new TypeError("Cannot stringify data with circular references");throw r}},r.prototype.parse=function(r,t){return JSON.parse(r,t)},r.prototype.serialize=function(r){return this.stringify(r,this.options.replacer||null,this.options.pretty?this.options.indent||2:void 0)},r.prototype.deserialize=function(r,t){try{return this.parse(r)}catch(r){return t}},r.prototype.serializeArray=function(r){return"["+r.map((function(r){return JSON.stringify(r)})).join(",")+"]"},r}();Xf=Symbol.toStringTag,function(){function r(r,t){void 0===t&&(t=new rs),this.storage=r,this.serializer=t,this.store={}}Object.defineProperty(r.prototype,"length",{get:function(){return this.storage?this.storage.length:Object.keys(this.store).length},enumerable:!1,configurable:!0}),r.prototype.setItem=function(r,t,n){var e={key:r,value:t,expire:n};"number"==typeof n&&n>0&&(e.expire=n);var o=this.serializer.serialize(e);this.storage?this.storage.setItem(r,o):this.store[r]=o},r.prototype.getItem=function(r,t){var n,e=this.storage?this.storage.getItem(r):this.store[r],o=null!=t?t:null;if(!e)return o;var i=this.serializer.deserialize(e,o);return"object"==typeof i?"number"==typeof i.expire&&i.expire<Date.now()?(this.removeItem(r),o):null!==(n=null==i?void 0:i.value)&&void 0!==n?n:o:o},r.prototype.removeItem=function(r){this.storage?this.storage.removeItem(r):delete this.store[r]},r.prototype.clear=function(){this.storage?this.storage.clear():this.store={}}}();const ts=(r=0)=>t=>`[${t+r}m`,ns=(r=0)=>t=>`[${38+r};5;${t}m`,es=(r=0)=>(t,n,e)=>`[${38+r};2;${t};${n};${e}m`,os={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]}};const is=function(){const r=new Map;for(const[t,n]of Object.entries(os)){for(const[t,e]of Object.entries(n))os[t]={open:`[${e[0]}m`,close:`[${e[1]}m`},n[t]=os[t],r.set(e[0],e[1]);Object.defineProperty(os,t,{value:n,enumerable:!1})}return Object.defineProperty(os,"codes",{value:r,enumerable:!1}),os.color.close="[39m",os.bgColor.close="[49m",os.color.ansi=ts(),os.color.ansi256=ns(),os.color.ansi16m=es(),os.bgColor.ansi=ts(10),os.bgColor.ansi256=ns(10),os.bgColor.ansi16m=es(10),Object.defineProperties(os,{rgbToAnsi256:{value:(r,t,n)=>r===t&&t===n?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value(r){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!t)return[0,0,0];let[n]=t;3===n.length&&(n=[...n].map((r=>r+r)).join(""));const e=Number.parseInt(n,16);return[e>>16&255,e>>8&255,255&e]},enumerable:!1},hexToAnsi256:{value:r=>os.rgbToAnsi256(...os.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return r-8+90;let t,n,e;if(r>=232)t=(10*(r-232)+8)/255,n=t,e=t;else{const o=(r-=16)%36;t=Math.floor(r/36)/5,n=Math.floor(o/6)/5,e=o%6/5}const o=2*Math.max(t,n,e);if(0===o)return 30;let i=30+(Math.round(e)<<2|Math.round(n)<<1|Math.round(t));return 2===o&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(r,t,n)=>os.ansi256ToAnsi(os.rgbToAnsi256(r,t,n)),enumerable:!1},hexToAnsi:{value:r=>os.ansi256ToAnsi(os.hexToAnsi256(r)),enumerable:!1}}),os}(),us=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const r=navigator.userAgentData.brands.find((({brand:r})=>"Chromium"===r));if(r&&r.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),as=0!==us&&{level:us},cs={stdout:as,stderr:as};function fs(r,t,n){let e=r.indexOf(t);if(-1===e)return r;const o=t.length;let i=0,u="";do{u+=r.slice(i,e)+t+n,i=e+o,e=r.indexOf(t,i)}while(-1!==e);return u+=r.slice(i),u}const{stdout:ss,stderr:ls}=cs,ps=Symbol("GENERATOR"),hs=Symbol("STYLER"),vs=Symbol("IS_EMPTY"),ys=["ansi","ansi","ansi256","ansi16m"],gs=Object.create(null),ds=r=>{const t=(...r)=>r.join(" ");return((r,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const n=ss?ss.level:0;r.level=void 0===t.level?n:t.level})(t,r),Object.setPrototypeOf(t,bs.prototype),t};function bs(r){return ds(r)}Object.setPrototypeOf(bs.prototype,Function.prototype);for(const[r,t]of Object.entries(is))gs[r]={get(){const n=ws(this,js(t.open,t.close,this[hs]),this[vs]);return Object.defineProperty(this,r,{value:n}),n}};gs.visible={get(){const r=ws(this,this[hs],!0);return Object.defineProperty(this,"visible",{value:r}),r}};const _s=(r,t,n,...e)=>"rgb"===r?"ansi16m"===t?is[n].ansi16m(...e):"ansi256"===t?is[n].ansi256(is.rgbToAnsi256(...e)):is[n].ansi(is.rgbToAnsi(...e)):"hex"===r?_s("rgb",t,n,...is.hexToRgb(...e)):is[n][r](...e),ms=["rgb","hex","ansi256"];for(const r of ms){gs[r]={get(){const{level:t}=this;return function(...n){const e=js(_s(r,ys[t],"color",...n),is.color.close,this[hs]);return ws(this,e,this[vs])}}};gs["bg"+r[0].toUpperCase()+r.slice(1)]={get(){const{level:t}=this;return function(...n){const e=js(_s(r,ys[t],"bgColor",...n),is.bgColor.close,this[hs]);return ws(this,e,this[vs])}}}}const Os=Object.defineProperties((()=>{}),{...gs,level:{enumerable:!0,get(){return this[ps].level},set(r){this[ps].level=r}}}),js=(r,t,n)=>{let e,o;return void 0===n?(e=r,o=t):(e=n.openAll+r,o=t+n.closeAll),{open:r,close:t,openAll:e,closeAll:o,parent:n}},ws=(r,t,n)=>{const e=(...r)=>Rs(e,1===r.length?""+r[0]:r.join(" "));return Object.setPrototypeOf(e,Os),e[ps]=r,e[hs]=t,e[vs]=n,e},Rs=(r,t)=>{if(r.level<=0||!t)return r[vs]?"":t;let n=r[hs];if(void 0===n)return t;const{openAll:e,closeAll:o}=n;if(t.includes(""))for(;void 0!==n;)t=fs(t,n.close,n.open),n=n.parent;const i=t.indexOf("\n");return-1!==i&&(t=function(r,t,n,e){let o=0,i="";do{const u="\r"===r[e-1];i+=r.slice(o,u?e-1:e)+t+(u?"\r\n":"\n")+n,o=e+1,e=r.indexOf("\n",o)}while(-1!==e);return i+=r.slice(o),i}(t,o,e,i)),e+t+o};Object.defineProperties(bs.prototype,gs);const ks=bs();bs({level:ls?ls.level:0});class xs extends Sf{prefix(r){switch(r){case"INFO":return ks.blue(r);case"WARN":return ks.yellow(r);case"ERROR":return ks.red(r);case"DEBUG":return ks.gray(r);default:return r}}obtrusive(r){const t=ks.bold(r);super.obtrusive(t)}}const Ps=(r,n)=>{const e=Array.isArray(r)?r.join(" "):r;return new Promise(((r,o)=>{t(e,{encoding:"utf-8",...n},((t,n,e)=>{t||e?o(t||e):r(n)}))}))};function As(r){return new To({name:"fe-config",defaultConfig:Ji({},Co,r)})}class Es{logger;shell;feConfig;dryRun;verbose;options;constructor(r){const{logger:t,shell:n,feConfig:e,dryRun:o,verbose:i,options:u}=r||{},a=u||{};this.logger=t||new xs({debug:i,dryRun:o}),this.shell=n||new Wi({logger:this.logger,dryRun:o,execPromise:a.execPromise||Ps}),this.feConfig=As(e).config,this.dryRun=!!o,this.verbose=!!i,this.options=a}}export{To as ConfigSearch,Es as FeScriptContext,xs as ScriptsLogger,Wi as Shell,Co as defaultFeConfig,As as getFeConfigSearch};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qlover/scripts-context",
|
|
3
3
|
"description": "A scripts context for frontwork",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
7
7
|
"homepage": "https://github.com/qlover/fe-base/tree/master/packages/scripts-context#readme",
|
|
@@ -43,14 +43,13 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/shelljs": "^0.8.15",
|
|
46
|
-
"@qlover/fe-standard": "latest"
|
|
46
|
+
"@qlover/fe-standard": "latest",
|
|
47
|
+
"@qlover/env-loader": "latest"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
50
|
"@qlover/fe-utils": "latest",
|
|
50
51
|
"chalk": "^5.3.0",
|
|
51
52
|
"cosmiconfig": "^9.0.0",
|
|
52
|
-
"lodash": "^4.17.21"
|
|
53
|
-
"shelljs": "^0.8.5",
|
|
54
|
-
"merge": "^2.1.1"
|
|
53
|
+
"lodash": "^4.17.21"
|
|
55
54
|
}
|
|
56
55
|
}
|