@mavenagi/apps 1.0.1 → 1.0.3
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/LICENSE +141 -0
- package/dist/index.js +1 -45
- package/package.json +5 -22
- package/dist/next.js +0 -1
- package/index.ts +0 -52
- package/tsconfig.json +0 -108
package/LICENSE
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
MAVEN SOURCE CODE LICENSE
|
|
2
|
+
|
|
3
|
+
This Maven Source Code License ("License") is a binding legal agreement between you
|
|
4
|
+
(referred to in this License as "you" or "Licensee") and Maven AGI, Inc. (the
|
|
5
|
+
"Company") and governs your access to and use of the Licensed Source Code (as
|
|
6
|
+
defined below).
|
|
7
|
+
|
|
8
|
+
By accessing or using the Licensed Source Code (as defined below), you agree to be
|
|
9
|
+
bound by the terms of this License. You may not use the Licensed Source Code if you
|
|
10
|
+
are not of legal age to form a binding contract with the Company.
|
|
11
|
+
|
|
12
|
+
If you are using the Licensed Source Code on behalf of a company, organization,
|
|
13
|
+
government, or other entity, you represent and warrant that you have the authority
|
|
14
|
+
to bind such company, organization, government, or entity to this License, in which
|
|
15
|
+
case the words "you" "your" and "Licensee" as used in this License shall refer to
|
|
16
|
+
you and such entity.
|
|
17
|
+
|
|
18
|
+
1. LICENSE AND RESTRICTIONS
|
|
19
|
+
|
|
20
|
+
1.1. License. Subject to the terms and conditions of this License, Company hereby
|
|
21
|
+
grants to Licensee a perpetual, worldwide, non-exclusive, royalty-free copyright
|
|
22
|
+
license to use, reproduce, prepare derivative works of, publicly display, publicly
|
|
23
|
+
perform, and distribute the source code, application programming interfaces,
|
|
24
|
+
software development kits and related tools, documentation, data, technology, code,
|
|
25
|
+
and materials that the Company makes available under this License (such items,
|
|
26
|
+
including any modifications, enhancements or new versions that are made available
|
|
27
|
+
by Company during the term of this License, the "Licensed Source Code"), in each
|
|
28
|
+
case solely in connection with the Company's artificial intelligence-powered
|
|
29
|
+
customer experience platform (the "Maven Platform"). For the avoidance of doubt,
|
|
30
|
+
any access to or use of the Maven Platform is subject to a separate agreement.
|
|
31
|
+
|
|
32
|
+
1.2. Restrictions. Licensee shall not (and shall not allow any other person to):
|
|
33
|
+
(a) use the Licensed Source Code in violation of any applicable laws or
|
|
34
|
+
regulations; (b) use the Licensed Source Code to develop any software or
|
|
35
|
+
applications for any product, software or service other than the Maven Platform;
|
|
36
|
+
(c) modify, distribute, or use the Licensed Source Code in a manner that would
|
|
37
|
+
subject the Licensed Source Code to any open source software license terms; or (d)
|
|
38
|
+
remove, modify or otherwise tamper with any notices or legends on or in the
|
|
39
|
+
Licensed Source Code or any labeling on any physical media. This License does not
|
|
40
|
+
grant permission to use the trade names, trademarks, service marks, or product
|
|
41
|
+
names of the Company.
|
|
42
|
+
|
|
43
|
+
1.3. Ownership. As between the Company and Licensee, the Company retains all
|
|
44
|
+
right, title and interest in and to all intellectual property rights embodied in
|
|
45
|
+
or pertaining to the Licensed Source Code. There are no implied licenses under
|
|
46
|
+
this License, and any rights not expressly granted to Licensee hereunder are
|
|
47
|
+
reserved by the Company. Licensee shall not take any action inconsistent with the
|
|
48
|
+
Company's ownership of the Licensed Source Code.
|
|
49
|
+
|
|
50
|
+
2. TERM AND TERMINATION
|
|
51
|
+
|
|
52
|
+
2.1. Term; Termination. This License shall commence on the date that Licensee
|
|
53
|
+
first accesses or uses the Licensed Source Code and shall continue until
|
|
54
|
+
terminated in accordance with this Section 2.1. This License may be terminated by
|
|
55
|
+
either party (a) upon written notice to the other party if the other party
|
|
56
|
+
materially breaches any term of this License and fails to cure such breach within
|
|
57
|
+
30 days of written notice or (b) for any reason upon written notice to the other
|
|
58
|
+
party. Upon termination of this License, Licensee shall cease access to and use of
|
|
59
|
+
the Licensed Source Code and destroy all local copies thereof in its possession or
|
|
60
|
+
control. The provisions of Sections 1.2., 1.3, 2.1, 3 and 4 shall survive any
|
|
61
|
+
termination of this License.
|
|
62
|
+
|
|
63
|
+
3. DISCLAIMER; INDEMNITY; LIMITATION OF LIABILITY
|
|
64
|
+
|
|
65
|
+
3.1. Disclaimer of Other Warranties. Company is not obligated to provide any
|
|
66
|
+
technical or other support for the Licensed Source Code. Unless required by
|
|
67
|
+
applicable law, the Company provides the Licensed Source Code on an "AS IS" BASIS,
|
|
68
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including,
|
|
69
|
+
without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
|
|
70
|
+
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible
|
|
71
|
+
for determining the appropriateness of using the Licensed Source Code and assume
|
|
72
|
+
any risks associated with your exercise of the permissions under this License. YOU
|
|
73
|
+
ACKNOWLEDGE THAT YOU HAVE NOT ENTERED INTO THIS AGREEMENT IN RELIANCE UPON ANY
|
|
74
|
+
WARRANTY OR REPRESENTATION EXCEPT THOSE SPECIFICALLY SET FORTH HEREIN.
|
|
75
|
+
|
|
76
|
+
3.2. Limitation of Liability. In no event and under no legal theory, whether in
|
|
77
|
+
tort (including negligence), contract, or otherwise, unless required by applicable
|
|
78
|
+
law (such as deliberate and grossly negligent acts) or agreed to in writing,
|
|
79
|
+
shall the Company be liable to Licensee for any damages, including any direct,
|
|
80
|
+
indirect, special, incidental, or consequential damages of any character arising
|
|
81
|
+
as a result of this License or out of the use or inability to use the Licensed
|
|
82
|
+
Source Code (including but not limited to damages for loss of goodwill, work
|
|
83
|
+
stoppage, computer failure or malfunction, or any and all other commercial damages
|
|
84
|
+
or losses), even if the Company has been advised of the possibility of such
|
|
85
|
+
damages.
|
|
86
|
+
|
|
87
|
+
4. MISCELLANEOUS.
|
|
88
|
+
|
|
89
|
+
Dispute Resolution; Governing Law. This License and any dispute arising under or
|
|
90
|
+
in connection with this License shall be governed by the laws of the State of
|
|
91
|
+
Delaware, without regard to its choice of law principles. Each party irrevocably
|
|
92
|
+
and unconditionally submits to the exclusive jurisdiction of such courts;
|
|
93
|
+
provided, however, that notwithstanding the foregoing, either party may seek
|
|
94
|
+
injunctive or other equitable relief at any time in courts of competent
|
|
95
|
+
jurisdiction.
|
|
96
|
+
|
|
97
|
+
Assignment. Licensee may not assign this License, or any of its rights or
|
|
98
|
+
obligations hereunder, without the prior written consent of the Company and any
|
|
99
|
+
assignment in violation of this provision shall be null and void from the
|
|
100
|
+
beginning. The Company may freely assign this License, or any of its rights or
|
|
101
|
+
obligations hereunder, without Licensee's prior written consent. Subject to the
|
|
102
|
+
foregoing limitation on assignment, this License is binding upon and inures to the
|
|
103
|
+
benefit of the successors and assigns of the respective parties hereto.
|
|
104
|
+
|
|
105
|
+
No Agency Relationship. The relationship between the Company and Licensee shall
|
|
106
|
+
not be construed as a joint venture, partnership or principal-agent relationship.
|
|
107
|
+
|
|
108
|
+
Third Party Beneficiaries. This License is not intended and shall not be
|
|
109
|
+
construed to create any rights or benefits upon any person not a party to this
|
|
110
|
+
License.
|
|
111
|
+
|
|
112
|
+
Entire Agreement. This License constitutes the entire agreement between the
|
|
113
|
+
parties relating to the subject matter hereof. This License supersedes all prior
|
|
114
|
+
understandings, negotiations and discussions, written or oral, of the parties
|
|
115
|
+
relating to the transactions contemplated by this License.
|
|
116
|
+
|
|
117
|
+
Modification. The Company may modify this License from time to time upon notice to
|
|
118
|
+
Licensee. The modified License will be effective as of the time of posting, or
|
|
119
|
+
such later date as may be specified in the applicable notice. Licensee's
|
|
120
|
+
continued access to or use of the Licensed Source Code after the modifications
|
|
121
|
+
have become effective will be deemed Licensee's acceptance of the modified
|
|
122
|
+
License. If Licensee does not agree with such modifications, Licensee's sole
|
|
123
|
+
option is to cease access to and use of the Licensed Source Code.
|
|
124
|
+
|
|
125
|
+
Provisions Severable. If any provision of this License shall be or become wholly
|
|
126
|
+
or partially invalid, illegal or unenforceable, such provision shall be enforced
|
|
127
|
+
to the extent that it is legal and valid and the validity, legality, and
|
|
128
|
+
enforceability of the remaining provisions shall in no way be affected or
|
|
129
|
+
impaired.
|
|
130
|
+
|
|
131
|
+
Waivers; Cumulative Remedies; Injunctive Relief. No failure or delay by a party
|
|
132
|
+
to insist upon the strict performance of any term or condition under this License
|
|
133
|
+
or to exercise any right or remedy available under this License at law or in
|
|
134
|
+
equity, shall imply or otherwise constitute a waiver of such right or remedy, and
|
|
135
|
+
no single or partial exercise of any right or remedy by any party will preclude
|
|
136
|
+
exercise of any other right or remedy. All rights and remedies provided in this
|
|
137
|
+
License are cumulative and not alternative; and are in addition to all other
|
|
138
|
+
available remedies at law or in equity.
|
|
139
|
+
|
|
140
|
+
How to Contact Us. You may contact us regarding this License at:
|
|
141
|
+
131 Dartmouth St, 3rd Floor, Boston, MA 02116
|
package/dist/index.js
CHANGED
|
@@ -1,46 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { execFileSync } from 'child_process';
|
|
3
|
-
import fs from 'fs';
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
import { compiledUserWorkerEntrypointScript } from './next.js';
|
|
6
|
-
const p = (f) => `${fs.existsSync('./src') ? 'src/' : ''}${f}`;
|
|
7
|
-
fs.rmSync(p('app/mavenagi-cgi'), { recursive: true, force: true });
|
|
8
|
-
fs.mkdirSync(p('app/mavenagi-cgi'), { recursive: true });
|
|
9
|
-
fs.writeFileSync(p('app/mavenagi-cgi/next.ts'), `// @ts-nocheck\n${compiledUserWorkerEntrypointScript}`);
|
|
10
|
-
Object.entries({
|
|
11
|
-
'pre-install': 'preInstall',
|
|
12
|
-
'post-install': 'postInstall',
|
|
13
|
-
feedbacks: 'feedbackCreatedOrUpdated',
|
|
14
|
-
conversations: 'conversationCreatedOrUpdated',
|
|
15
|
-
'execute-action': 'executeAction',
|
|
16
|
-
'knowledge-base-refreshed': 'knowledgeBaseRefreshed',
|
|
17
|
-
}).forEach(([f, name]) => {
|
|
18
|
-
fs.mkdirSync(p(`app/mavenagi-cgi/v1/${f}`), { recursive: true });
|
|
19
|
-
const indexFileContents = fs.readFileSync(p(`index.ts`), 'utf8');
|
|
20
|
-
const isEdge = indexFileContents.includes("export const runtime = 'edge'") ||
|
|
21
|
-
indexFileContents.includes('export const runtime = "edge"');
|
|
22
|
-
fs.writeFileSync(p(`app/mavenagi-cgi/v1/${f}/route.ts`), `// @ts-nocheck\nimport {${name}} from '../../next'
|
|
23
|
-
import userWorker from '../../../..'
|
|
24
|
-
|
|
25
|
-
export const POST = ${name}
|
|
26
|
-
export const runtime = ${isEdge ? "'edge'" : "'nodejs'"}
|
|
27
|
-
export const maxDuration = 900
|
|
28
|
-
`);
|
|
29
|
-
});
|
|
30
|
-
let packageManager = 'npm';
|
|
31
|
-
if (fs.existsSync('yarn.lock')) {
|
|
32
|
-
packageManager = 'yarn';
|
|
33
|
-
}
|
|
34
|
-
else if (fs.existsSync('pnpm-lock.yaml')) {
|
|
35
|
-
packageManager = 'pnpm';
|
|
36
|
-
}
|
|
37
|
-
else if (fs.existsSync('bun.lockb')) {
|
|
38
|
-
packageManager = 'bun';
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
execFileSync(packageManager, ['run', ...process.argv.slice(2)], { stdio: 'inherit' });
|
|
42
|
-
process.exit(0);
|
|
43
|
-
}
|
|
44
|
-
catch (err) {
|
|
45
|
-
process.exit(err.status || 1);
|
|
46
|
-
}
|
|
2
|
+
(()=>{var t={8587:t=>{"use strict";t.exports=({onlyFirst:t=false}={})=>{const s=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(s,t?undefined:"g")}},3694:(t,s,b)=>{"use strict";t=b.nmd(t);const wrapAnsi16=(t,s)=>(...b)=>{const F=t(...b);return`[${F+s}m`};const wrapAnsi256=(t,s)=>(...b)=>{const F=t(...b);return`[${38+s};5;${F}m`};const wrapAnsi16m=(t,s)=>(...b)=>{const F=t(...b);return`[${38+s};2;${F[0]};${F[1]};${F[2]}m`};const ansi2ansi=t=>t;const rgb2rgb=(t,s,b)=>[t,s,b];const setLazyProperty=(t,s,b)=>{Object.defineProperty(t,s,{get:()=>{const F=b();Object.defineProperty(t,s,{value:F,enumerable:true,configurable:true});return F},enumerable:true,configurable:true})};let F;const makeDynamicStyles=(t,s,B,T)=>{if(F===undefined){F=b(7319)}const M=T?10:0;const R={};for(const[b,T]of Object.entries(F)){const F=b==="ansi16"?"ansi":b;if(b===s){R[F]=t(B,M)}else if(typeof T==="object"){R[F]=t(T[s],M)}}return R};function assembleStyles(){const t=new Map;const s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};s.color.gray=s.color.blackBright;s.bgColor.bgGray=s.bgColor.bgBlackBright;s.color.grey=s.color.blackBright;s.bgColor.bgGrey=s.bgColor.bgBlackBright;for(const[b,F]of Object.entries(s)){for(const[b,B]of Object.entries(F)){s[b]={open:`[${B[0]}m`,close:`[${B[1]}m`};F[b]=s[b];t.set(B[0],B[1])}Object.defineProperty(s,b,{value:F,enumerable:false})}Object.defineProperty(s,"codes",{value:t,enumerable:false});s.color.close="[39m";s.bgColor.close="[49m";setLazyProperty(s.color,"ansi",(()=>makeDynamicStyles(wrapAnsi16,"ansi16",ansi2ansi,false)));setLazyProperty(s.color,"ansi256",(()=>makeDynamicStyles(wrapAnsi256,"ansi256",ansi2ansi,false)));setLazyProperty(s.color,"ansi16m",(()=>makeDynamicStyles(wrapAnsi16m,"rgb",rgb2rgb,false)));setLazyProperty(s.bgColor,"ansi",(()=>makeDynamicStyles(wrapAnsi16,"ansi16",ansi2ansi,true)));setLazyProperty(s.bgColor,"ansi256",(()=>makeDynamicStyles(wrapAnsi256,"ansi256",ansi2ansi,true)));setLazyProperty(s.bgColor,"ansi16m",(()=>makeDynamicStyles(wrapAnsi16m,"rgb",rgb2rgb,true)));return s}Object.defineProperty(t,"exports",{enumerable:true,get:assembleStyles})},2986:(t,s,b)=>{"use strict";const F=b(1838);const B=b(764);const T=b(3694);const M=new Set(["",""]);const R=39;const U="";const L="[";const W="]";const K="m";const z=`${W}8;;`;const wrapAnsi=t=>`${M.values().next().value}${L}${t}${K}`;const wrapAnsiHyperlink=t=>`${M.values().next().value}${z}${t}${U}`;const wordLengths=t=>t.split(" ").map((t=>F(t)));const wrapWord=(t,s,b)=>{const T=[...s];let R=false;let L=false;let W=F(B(t[t.length-1]));for(const[s,B]of T.entries()){const G=F(B);if(W+G<=b){t[t.length-1]+=B}else{t.push(B);W=0}if(M.has(B)){R=true;L=T.slice(s+1).join("").startsWith(z)}if(R){if(L){if(B===U){R=false;L=false}}else if(B===K){R=false}continue}W+=G;if(W===b&&s<T.length-1){t.push("");W=0}}if(!W&&t[t.length-1].length>0&&t.length>1){t[t.length-2]+=t.pop()}};const stringVisibleTrimSpacesRight=t=>{const s=t.split(" ");let b=s.length;while(b>0){if(F(s[b-1])>0){break}b--}if(b===s.length){return t}return s.slice(0,b).join(" ")+s.slice(b).join("")};const exec=(t,s,b={})=>{if(b.trim!==false&&t.trim()===""){return""}let B="";let W;let K;const G=wordLengths(t);let H=[""];for(const[B,T]of t.split(" ").entries()){if(b.trim!==false){H[H.length-1]=H[H.length-1].trimStart()}let t=F(H[H.length-1]);if(B!==0){if(t>=s&&(b.wordWrap===false||b.trim===false)){H.push("");t=0}if(t>0||b.trim===false){H[H.length-1]+=" ";t++}}if(b.hard&&G[B]>s){const b=s-t;const F=1+Math.floor((G[B]-b-1)/s);const M=Math.floor((G[B]-1)/s);if(M<F){H.push("")}wrapWord(H,T,s);continue}if(t+G[B]>s&&t>0&&G[B]>0){if(b.wordWrap===false&&t<s){wrapWord(H,T,s);continue}H.push("")}if(t+G[B]>s&&b.wordWrap===false){wrapWord(H,T,s);continue}H[H.length-1]+=T}if(b.trim!==false){H=H.map(stringVisibleTrimSpacesRight)}const V=[...H.join("\n")];for(const[t,s]of V.entries()){B+=s;if(M.has(s)){const{groups:s}=new RegExp(`(?:\\${L}(?<code>\\d+)m|\\${z}(?<uri>.*)${U})`).exec(V.slice(t).join(""))||{groups:{}};if(s.code!==undefined){const t=Number.parseFloat(s.code);W=t===R?undefined:t}else if(s.uri!==undefined){K=s.uri.length===0?undefined:s.uri}}const b=T.codes.get(Number(W));if(V[t+1]==="\n"){if(K){B+=wrapAnsiHyperlink("")}if(W&&b){B+=wrapAnsi(b)}}else if(s==="\n"){if(W&&b){B+=wrapAnsi(W)}if(K){B+=wrapAnsiHyperlink(K)}}}return B};t.exports=(t,s,b)=>String(t).normalize().replace(/\r\n/g,"\n").split("\n").map((t=>exec(t,s,b))).join("\n")},9006:(t,s,b)=>{const F=b(8147);const B={};for(const t of Object.keys(F)){B[F[t]]=t}const T={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};t.exports=T;for(const t of Object.keys(T)){if(!("channels"in T[t])){throw new Error("missing channels property: "+t)}if(!("labels"in T[t])){throw new Error("missing channel labels property: "+t)}if(T[t].labels.length!==T[t].channels){throw new Error("channel and label counts mismatch: "+t)}const{channels:s,labels:b}=T[t];delete T[t].channels;delete T[t].labels;Object.defineProperty(T[t],"channels",{value:s});Object.defineProperty(T[t],"labels",{value:b})}T.rgb.hsl=function(t){const s=t[0]/255;const b=t[1]/255;const F=t[2]/255;const B=Math.min(s,b,F);const T=Math.max(s,b,F);const M=T-B;let R;let U;if(T===B){R=0}else if(s===T){R=(b-F)/M}else if(b===T){R=2+(F-s)/M}else if(F===T){R=4+(s-b)/M}R=Math.min(R*60,360);if(R<0){R+=360}const L=(B+T)/2;if(T===B){U=0}else if(L<=.5){U=M/(T+B)}else{U=M/(2-T-B)}return[R,U*100,L*100]};T.rgb.hsv=function(t){let s;let b;let F;let B;let T;const M=t[0]/255;const R=t[1]/255;const U=t[2]/255;const L=Math.max(M,R,U);const W=L-Math.min(M,R,U);const diffc=function(t){return(L-t)/6/W+1/2};if(W===0){B=0;T=0}else{T=W/L;s=diffc(M);b=diffc(R);F=diffc(U);if(M===L){B=F-b}else if(R===L){B=1/3+s-F}else if(U===L){B=2/3+b-s}if(B<0){B+=1}else if(B>1){B-=1}}return[B*360,T*100,L*100]};T.rgb.hwb=function(t){const s=t[0];const b=t[1];let F=t[2];const B=T.rgb.hsl(t)[0];const M=1/255*Math.min(s,Math.min(b,F));F=1-1/255*Math.max(s,Math.max(b,F));return[B,M*100,F*100]};T.rgb.cmyk=function(t){const s=t[0]/255;const b=t[1]/255;const F=t[2]/255;const B=Math.min(1-s,1-b,1-F);const T=(1-s-B)/(1-B)||0;const M=(1-b-B)/(1-B)||0;const R=(1-F-B)/(1-B)||0;return[T*100,M*100,R*100,B*100]};function comparativeDistance(t,s){return(t[0]-s[0])**2+(t[1]-s[1])**2+(t[2]-s[2])**2}T.rgb.keyword=function(t){const s=B[t];if(s){return s}let b=Infinity;let T;for(const s of Object.keys(F)){const B=F[s];const M=comparativeDistance(t,B);if(M<b){b=M;T=s}}return T};T.keyword.rgb=function(t){return F[t]};T.rgb.xyz=function(t){let s=t[0]/255;let b=t[1]/255;let F=t[2]/255;s=s>.04045?((s+.055)/1.055)**2.4:s/12.92;b=b>.04045?((b+.055)/1.055)**2.4:b/12.92;F=F>.04045?((F+.055)/1.055)**2.4:F/12.92;const B=s*.4124+b*.3576+F*.1805;const T=s*.2126+b*.7152+F*.0722;const M=s*.0193+b*.1192+F*.9505;return[B*100,T*100,M*100]};T.rgb.lab=function(t){const s=T.rgb.xyz(t);let b=s[0];let F=s[1];let B=s[2];b/=95.047;F/=100;B/=108.883;b=b>.008856?b**(1/3):7.787*b+16/116;F=F>.008856?F**(1/3):7.787*F+16/116;B=B>.008856?B**(1/3):7.787*B+16/116;const M=116*F-16;const R=500*(b-F);const U=200*(F-B);return[M,R,U]};T.hsl.rgb=function(t){const s=t[0]/360;const b=t[1]/100;const F=t[2]/100;let B;let T;let M;if(b===0){M=F*255;return[M,M,M]}if(F<.5){B=F*(1+b)}else{B=F+b-F*b}const R=2*F-B;const U=[0,0,0];for(let t=0;t<3;t++){T=s+1/3*-(t-1);if(T<0){T++}if(T>1){T--}if(6*T<1){M=R+(B-R)*6*T}else if(2*T<1){M=B}else if(3*T<2){M=R+(B-R)*(2/3-T)*6}else{M=R}U[t]=M*255}return U};T.hsl.hsv=function(t){const s=t[0];let b=t[1]/100;let F=t[2]/100;let B=b;const T=Math.max(F,.01);F*=2;b*=F<=1?F:2-F;B*=T<=1?T:2-T;const M=(F+b)/2;const R=F===0?2*B/(T+B):2*b/(F+b);return[s,R*100,M*100]};T.hsv.rgb=function(t){const s=t[0]/60;const b=t[1]/100;let F=t[2]/100;const B=Math.floor(s)%6;const T=s-Math.floor(s);const M=255*F*(1-b);const R=255*F*(1-b*T);const U=255*F*(1-b*(1-T));F*=255;switch(B){case 0:return[F,U,M];case 1:return[R,F,M];case 2:return[M,F,U];case 3:return[M,R,F];case 4:return[U,M,F];case 5:return[F,M,R]}};T.hsv.hsl=function(t){const s=t[0];const b=t[1]/100;const F=t[2]/100;const B=Math.max(F,.01);let T;let M;M=(2-b)*F;const R=(2-b)*B;T=b*B;T/=R<=1?R:2-R;T=T||0;M/=2;return[s,T*100,M*100]};T.hwb.rgb=function(t){const s=t[0]/360;let b=t[1]/100;let F=t[2]/100;const B=b+F;let T;if(B>1){b/=B;F/=B}const M=Math.floor(6*s);const R=1-F;T=6*s-M;if((M&1)!==0){T=1-T}const U=b+T*(R-b);let L;let W;let K;switch(M){default:case 6:case 0:L=R;W=U;K=b;break;case 1:L=U;W=R;K=b;break;case 2:L=b;W=R;K=U;break;case 3:L=b;W=U;K=R;break;case 4:L=U;W=b;K=R;break;case 5:L=R;W=b;K=U;break}return[L*255,W*255,K*255]};T.cmyk.rgb=function(t){const s=t[0]/100;const b=t[1]/100;const F=t[2]/100;const B=t[3]/100;const T=1-Math.min(1,s*(1-B)+B);const M=1-Math.min(1,b*(1-B)+B);const R=1-Math.min(1,F*(1-B)+B);return[T*255,M*255,R*255]};T.xyz.rgb=function(t){const s=t[0]/100;const b=t[1]/100;const F=t[2]/100;let B;let T;let M;B=s*3.2406+b*-1.5372+F*-.4986;T=s*-.9689+b*1.8758+F*.0415;M=s*.0557+b*-.204+F*1.057;B=B>.0031308?1.055*B**(1/2.4)-.055:B*12.92;T=T>.0031308?1.055*T**(1/2.4)-.055:T*12.92;M=M>.0031308?1.055*M**(1/2.4)-.055:M*12.92;B=Math.min(Math.max(0,B),1);T=Math.min(Math.max(0,T),1);M=Math.min(Math.max(0,M),1);return[B*255,T*255,M*255]};T.xyz.lab=function(t){let s=t[0];let b=t[1];let F=t[2];s/=95.047;b/=100;F/=108.883;s=s>.008856?s**(1/3):7.787*s+16/116;b=b>.008856?b**(1/3):7.787*b+16/116;F=F>.008856?F**(1/3):7.787*F+16/116;const B=116*b-16;const T=500*(s-b);const M=200*(b-F);return[B,T,M]};T.lab.xyz=function(t){const s=t[0];const b=t[1];const F=t[2];let B;let T;let M;T=(s+16)/116;B=b/500+T;M=T-F/200;const R=T**3;const U=B**3;const L=M**3;T=R>.008856?R:(T-16/116)/7.787;B=U>.008856?U:(B-16/116)/7.787;M=L>.008856?L:(M-16/116)/7.787;B*=95.047;T*=100;M*=108.883;return[B,T,M]};T.lab.lch=function(t){const s=t[0];const b=t[1];const F=t[2];let B;const T=Math.atan2(F,b);B=T*360/2/Math.PI;if(B<0){B+=360}const M=Math.sqrt(b*b+F*F);return[s,M,B]};T.lch.lab=function(t){const s=t[0];const b=t[1];const F=t[2];const B=F/360*2*Math.PI;const T=b*Math.cos(B);const M=b*Math.sin(B);return[s,T,M]};T.rgb.ansi16=function(t,s=null){const[b,F,B]=t;let M=s===null?T.rgb.hsv(t)[2]:s;M=Math.round(M/50);if(M===0){return 30}let R=30+(Math.round(B/255)<<2|Math.round(F/255)<<1|Math.round(b/255));if(M===2){R+=60}return R};T.hsv.ansi16=function(t){return T.rgb.ansi16(T.hsv.rgb(t),t[2])};T.rgb.ansi256=function(t){const s=t[0];const b=t[1];const F=t[2];if(s===b&&b===F){if(s<8){return 16}if(s>248){return 231}return Math.round((s-8)/247*24)+232}const B=16+36*Math.round(s/255*5)+6*Math.round(b/255*5)+Math.round(F/255*5);return B};T.ansi16.rgb=function(t){let s=t%10;if(s===0||s===7){if(t>50){s+=3.5}s=s/10.5*255;return[s,s,s]}const b=(~~(t>50)+1)*.5;const F=(s&1)*b*255;const B=(s>>1&1)*b*255;const T=(s>>2&1)*b*255;return[F,B,T]};T.ansi256.rgb=function(t){if(t>=232){const s=(t-232)*10+8;return[s,s,s]}t-=16;let s;const b=Math.floor(t/36)/5*255;const F=Math.floor((s=t%36)/6)/5*255;const B=s%6/5*255;return[b,F,B]};T.rgb.hex=function(t){const s=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255);const b=s.toString(16).toUpperCase();return"000000".substring(b.length)+b};T.hex.rgb=function(t){const s=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!s){return[0,0,0]}let b=s[0];if(s[0].length===3){b=b.split("").map((t=>t+t)).join("")}const F=parseInt(b,16);const B=F>>16&255;const T=F>>8&255;const M=F&255;return[B,T,M]};T.rgb.hcg=function(t){const s=t[0]/255;const b=t[1]/255;const F=t[2]/255;const B=Math.max(Math.max(s,b),F);const T=Math.min(Math.min(s,b),F);const M=B-T;let R;let U;if(M<1){R=T/(1-M)}else{R=0}if(M<=0){U=0}else if(B===s){U=(b-F)/M%6}else if(B===b){U=2+(F-s)/M}else{U=4+(s-b)/M}U/=6;U%=1;return[U*360,M*100,R*100]};T.hsl.hcg=function(t){const s=t[1]/100;const b=t[2]/100;const F=b<.5?2*s*b:2*s*(1-b);let B=0;if(F<1){B=(b-.5*F)/(1-F)}return[t[0],F*100,B*100]};T.hsv.hcg=function(t){const s=t[1]/100;const b=t[2]/100;const F=s*b;let B=0;if(F<1){B=(b-F)/(1-F)}return[t[0],F*100,B*100]};T.hcg.rgb=function(t){const s=t[0]/360;const b=t[1]/100;const F=t[2]/100;if(b===0){return[F*255,F*255,F*255]}const B=[0,0,0];const T=s%1*6;const M=T%1;const R=1-M;let U=0;switch(Math.floor(T)){case 0:B[0]=1;B[1]=M;B[2]=0;break;case 1:B[0]=R;B[1]=1;B[2]=0;break;case 2:B[0]=0;B[1]=1;B[2]=M;break;case 3:B[0]=0;B[1]=R;B[2]=1;break;case 4:B[0]=M;B[1]=0;B[2]=1;break;default:B[0]=1;B[1]=0;B[2]=R}U=(1-b)*F;return[(b*B[0]+U)*255,(b*B[1]+U)*255,(b*B[2]+U)*255]};T.hcg.hsv=function(t){const s=t[1]/100;const b=t[2]/100;const F=s+b*(1-s);let B=0;if(F>0){B=s/F}return[t[0],B*100,F*100]};T.hcg.hsl=function(t){const s=t[1]/100;const b=t[2]/100;const F=b*(1-s)+.5*s;let B=0;if(F>0&&F<.5){B=s/(2*F)}else if(F>=.5&&F<1){B=s/(2*(1-F))}return[t[0],B*100,F*100]};T.hcg.hwb=function(t){const s=t[1]/100;const b=t[2]/100;const F=s+b*(1-s);return[t[0],(F-s)*100,(1-F)*100]};T.hwb.hcg=function(t){const s=t[1]/100;const b=t[2]/100;const F=1-b;const B=F-s;let T=0;if(B<1){T=(F-B)/(1-B)}return[t[0],B*100,T*100]};T.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};T.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};T.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};T.gray.hsl=function(t){return[0,0,t[0]]};T.gray.hsv=T.gray.hsl;T.gray.hwb=function(t){return[0,100,t[0]]};T.gray.cmyk=function(t){return[0,0,0,t[0]]};T.gray.lab=function(t){return[t[0],0,0]};T.gray.hex=function(t){const s=Math.round(t[0]/100*255)&255;const b=(s<<16)+(s<<8)+s;const F=b.toString(16).toUpperCase();return"000000".substring(F.length)+F};T.rgb.gray=function(t){const s=(t[0]+t[1]+t[2])/3;return[s/255*100]}},7319:(t,s,b)=>{const F=b(9006);const B=b(2450);const T={};const M=Object.keys(F);function wrapRaw(t){const wrappedFn=function(...s){const b=s[0];if(b===undefined||b===null){return b}if(b.length>1){s=b}return t(s)};if("conversion"in t){wrappedFn.conversion=t.conversion}return wrappedFn}function wrapRounded(t){const wrappedFn=function(...s){const b=s[0];if(b===undefined||b===null){return b}if(b.length>1){s=b}const F=t(s);if(typeof F==="object"){for(let t=F.length,s=0;s<t;s++){F[s]=Math.round(F[s])}}return F};if("conversion"in t){wrappedFn.conversion=t.conversion}return wrappedFn}M.forEach((t=>{T[t]={};Object.defineProperty(T[t],"channels",{value:F[t].channels});Object.defineProperty(T[t],"labels",{value:F[t].labels});const s=B(t);const b=Object.keys(s);b.forEach((b=>{const F=s[b];T[t][b]=wrapRounded(F);T[t][b].raw=wrapRaw(F)}))}));t.exports=T},2450:(t,s,b)=>{const F=b(9006);function buildGraph(){const t={};const s=Object.keys(F);for(let b=s.length,F=0;F<b;F++){t[s[F]]={distance:-1,parent:null}}return t}function deriveBFS(t){const s=buildGraph();const b=[t];s[t].distance=0;while(b.length){const t=b.pop();const B=Object.keys(F[t]);for(let F=B.length,T=0;T<F;T++){const F=B[T];const M=s[F];if(M.distance===-1){M.distance=s[t].distance+1;M.parent=t;b.unshift(F)}}}return s}function link(t,s){return function(b){return s(t(b))}}function wrapConversion(t,s){const b=[s[t].parent,t];let B=F[s[t].parent][t];let T=s[t].parent;while(s[T].parent){b.unshift(s[T].parent);B=link(F[s[T].parent][T],B);T=s[T].parent}B.conversion=b;return B}t.exports=function(t){const s=deriveBFS(t);const b={};const F=Object.keys(s);for(let t=F.length,B=0;B<t;B++){const t=F[B];const T=s[t];if(T.parent===null){continue}b[t]=wrapConversion(t,s)}return b}},8147:t=>{"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},3220:(t,s,b)=>{"use strict";const F=b(5317);const B=b(8291);const T=b(2691);function spawn(t,s,b){const M=B(t,s,b);const R=F.spawn(M.command,M.args,M.options);T.hookChildProcess(R,M);return R}function spawnSync(t,s,b){const M=B(t,s,b);const R=F.spawnSync(M.command,M.args,M.options);R.error=R.error||T.verifyENOENTSync(R.status,M);return R}t.exports=spawn;t.exports.spawn=spawn;t.exports.sync=spawnSync;t.exports._parse=B;t.exports._enoent=T},2691:t=>{"use strict";const s=process.platform==="win32";function notFoundError(t,s){return Object.assign(new Error(`${s} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${s} ${t.command}`,path:t.command,spawnargs:t.args})}function hookChildProcess(t,b){if(!s){return}const F=t.emit;t.emit=function(s,B){if(s==="exit"){const s=verifyENOENT(B,b);if(s){return F.call(t,"error",s)}}return F.apply(t,arguments)}}function verifyENOENT(t,b){if(s&&t===1&&!b.file){return notFoundError(b.original,"spawn")}return null}function verifyENOENTSync(t,b){if(s&&t===1&&!b.file){return notFoundError(b.original,"spawnSync")}return null}t.exports={hookChildProcess:hookChildProcess,verifyENOENT:verifyENOENT,verifyENOENTSync:verifyENOENTSync,notFoundError:notFoundError}},8291:(t,s,b)=>{"use strict";const F=b(6928);const B=b(8032);const T=b(6878);const M=b(2537);const R=process.platform==="win32";const U=/\.(?:com|exe)$/i;const L=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(t){t.file=B(t);const s=t.file&&M(t.file);if(s){t.args.unshift(t.file);t.command=s;return B(t)}return t.file}function parseNonShell(t){if(!R){return t}const s=detectShebang(t);const b=!U.test(s);if(t.options.forceShell||b){const b=L.test(s);t.command=F.normalize(t.command);t.command=T.command(t.command);t.args=t.args.map((t=>T.argument(t,b)));const B=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${B}"`];t.command=process.env.comspec||"cmd.exe";t.options.windowsVerbatimArguments=true}return t}function parse(t,s,b){if(s&&!Array.isArray(s)){b=s;s=null}s=s?s.slice(0):[];b=Object.assign({},b);const F={command:t,args:s,options:b,file:undefined,original:{command:t,args:s}};return b.shell?F:parseNonShell(F)}t.exports=parse},6878:t=>{"use strict";const s=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(t){t=t.replace(s,"^$1");return t}function escapeArgument(t,b){t=`${t}`;t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"');t=t.replace(/(?=(\\+?)?)\1$/,"$1$1");t=`"${t}"`;t=t.replace(s,"^$1");if(b){t=t.replace(s,"^$1")}return t}t.exports.command=escapeCommand;t.exports.argument=escapeArgument},2537:(t,s,b)=>{"use strict";const F=b(9896);const B=b(934);function readShebang(t){const s=150;const b=Buffer.alloc(s);let T;try{T=F.openSync(t,"r");F.readSync(T,b,0,s,0);F.closeSync(T)}catch(t){}return B(b.toString())}t.exports=readShebang},8032:(t,s,b)=>{"use strict";const F=b(6928);const B=b(20);const T=b(8251);function resolveCommandAttempt(t,s){const b=t.options.env||process.env;const M=process.cwd();const R=t.options.cwd!=null;const U=R&&process.chdir!==undefined&&!process.chdir.disabled;if(U){try{process.chdir(t.options.cwd)}catch(t){}}let L;try{L=B.sync(t.command,{path:b[T({env:b})],pathExt:s?F.delimiter:undefined})}catch(t){}finally{if(U){process.chdir(M)}}if(L){L=F.resolve(R?t.options.cwd:"",L)}return L}function resolveCommand(t){return resolveCommandAttempt(t)||resolveCommandAttempt(t,true)}t.exports=resolveCommand},20:(t,s,b)=>{const F=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const B=b(6928);const T=F?";":":";const M=b(7210);const getNotFoundError=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"});const getPathInfo=(t,s)=>{const b=s.colon||T;const B=t.match(/\//)||F&&t.match(/\\/)?[""]:[...F?[process.cwd()]:[],...(s.path||process.env.PATH||"").split(b)];const M=F?s.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const R=F?M.split(b):[""];if(F){if(t.indexOf(".")!==-1&&R[0]!=="")R.unshift("")}return{pathEnv:B,pathExt:R,pathExtExe:M}};const which=(t,s,b)=>{if(typeof s==="function"){b=s;s={}}if(!s)s={};const{pathEnv:F,pathExt:T,pathExtExe:R}=getPathInfo(t,s);const U=[];const step=b=>new Promise(((T,M)=>{if(b===F.length)return s.all&&U.length?T(U):M(getNotFoundError(t));const R=F[b];const L=/^".*"$/.test(R)?R.slice(1,-1):R;const W=B.join(L,t);const K=!L&&/^\.[\\\/]/.test(t)?t.slice(0,2)+W:W;T(subStep(K,b,0))}));const subStep=(t,b,F)=>new Promise(((B,L)=>{if(F===T.length)return B(step(b+1));const W=T[F];M(t+W,{pathExt:R},((T,M)=>{if(!T&&M){if(s.all)U.push(t+W);else return B(t+W)}return B(subStep(t,b,F+1))}))}));return b?step(0).then((t=>b(null,t)),b):step(0)};const whichSync=(t,s)=>{s=s||{};const{pathEnv:b,pathExt:F,pathExtExe:T}=getPathInfo(t,s);const R=[];for(let U=0;U<b.length;U++){const L=b[U];const W=/^".*"$/.test(L)?L.slice(1,-1):L;const K=B.join(W,t);const z=!W&&/^\.[\\\/]/.test(t)?t.slice(0,2)+K:K;for(let t=0;t<F.length;t++){const b=z+F[t];try{const t=M.sync(b,{pathExt:T});if(t){if(s.all)R.push(b);else return b}}catch(t){}}}if(s.all&&R.length)return R;if(s.nothrow)return null;throw getNotFoundError(t)};t.exports=which;which.sync=whichSync},7020:(t,s,b)=>{const{dirname:F,resolve:B}=b(6928);const{readdirSync:T,statSync:M}=b(9896);t.exports=function(t,s){let b=B(".",t);let R,U=M(b);if(!U.isDirectory()){b=F(b)}while(true){R=s(b,T(b));if(R)return B(b,R);b=F(R=b);if(R===b)break}}},5426:(t,s,b)=>{"use strict";const F=b(6928);const B=b(5317);const T=b(3220);const M=b(2740);const R=b(7221);const U=b(163);const L=b(8244);const W=b(9487);const{spawnedKill:K,spawnedCancel:z,setupTimeout:G,validateTimeout:H,setExitHandler:V}=b(5676);const{handleInput:q,getSpawnedResult:J,makeAllStream:Y,validateInputSync:X}=b(7828);const{mergePromise:Z,getSpawnedPromise:Q}=b(6163);const{joinCommand:ee,parseCommand:re,getEscapedCommand:ne}=b(4835);const oe=1e3*1e3*100;const getEnv=({env:t,extendEnv:s,preferLocal:b,localDir:F,execPath:B})=>{const T=s?{...process.env,...t}:t;if(b){return R.env({env:T,cwd:F,execPath:B})}return T};const handleArguments=(t,s,b={})=>{const B=T._parse(t,s,b);t=B.command;s=B.args;b=B.options;b={maxBuffer:oe,buffer:true,stripFinalNewline:true,extendEnv:true,preferLocal:false,localDir:b.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:true,cleanup:true,all:false,windowsHide:true,...b};b.env=getEnv(b);b.stdio=W(b);if(process.platform==="win32"&&F.basename(t,".exe")==="cmd"){s.unshift("/q")}return{file:t,args:s,options:b,parsed:B}};const handleOutput=(t,s,b)=>{if(typeof s!=="string"&&!Buffer.isBuffer(s)){return b===undefined?undefined:""}if(t.stripFinalNewline){return M(s)}return s};const execa=(t,s,b)=>{const F=handleArguments(t,s,b);const T=ee(t,s);const M=ne(t,s);H(F.options);let R;try{R=B.spawn(F.file,F.args,F.options)}catch(t){const s=new B.ChildProcess;const b=Promise.reject(L({error:t,stdout:"",stderr:"",all:"",command:T,escapedCommand:M,parsed:F,timedOut:false,isCanceled:false,killed:false}));return Z(s,b)}const W=Q(R);const X=G(R,F.options,W);const re=V(R,F.options,X);const oe={isCanceled:false};R.kill=K.bind(null,R.kill.bind(R));R.cancel=z.bind(null,R,oe);const handlePromise=async()=>{const[{error:t,exitCode:s,signal:b,timedOut:B},U,W,K]=await J(R,F.options,re);const z=handleOutput(F.options,U);const G=handleOutput(F.options,W);const H=handleOutput(F.options,K);if(t||s!==0||b!==null){const U=L({error:t,exitCode:s,signal:b,stdout:z,stderr:G,all:H,command:T,escapedCommand:M,parsed:F,timedOut:B,isCanceled:oe.isCanceled,killed:R.killed});if(!F.options.reject){return U}throw U}return{command:T,escapedCommand:M,exitCode:0,stdout:z,stderr:G,all:H,failed:false,timedOut:false,isCanceled:false,killed:false}};const ie=U(handlePromise);q(R,F.options.input);R.all=Y(R,F.options);return Z(R,ie)};t.exports=execa;t.exports.sync=(t,s,b)=>{const F=handleArguments(t,s,b);const T=ee(t,s);const M=ne(t,s);X(F.options);let R;try{R=B.spawnSync(F.file,F.args,F.options)}catch(t){throw L({error:t,stdout:"",stderr:"",all:"",command:T,escapedCommand:M,parsed:F,timedOut:false,isCanceled:false,killed:false})}const U=handleOutput(F.options,R.stdout,R.error);const W=handleOutput(F.options,R.stderr,R.error);if(R.error||R.status!==0||R.signal!==null){const t=L({stdout:U,stderr:W,error:R.error,signal:R.signal,exitCode:R.status,command:T,escapedCommand:M,parsed:F,timedOut:R.error&&R.error.code==="ETIMEDOUT",isCanceled:false,killed:R.signal!==null});if(!F.options.reject){return t}throw t}return{command:T,escapedCommand:M,exitCode:0,stdout:U,stderr:W,failed:false,timedOut:false,isCanceled:false,killed:false}};t.exports.command=(t,s)=>{const[b,...F]=re(t);return execa(b,F,s)};t.exports.commandSync=(t,s)=>{const[b,...F]=re(t);return execa.sync(b,F,s)};t.exports.node=(t,s,b={})=>{if(s&&!Array.isArray(s)&&typeof s==="object"){b=s;s=[]}const F=W.node(b);const B=process.execArgv.filter((t=>!t.startsWith("--inspect")));const{nodePath:T=process.execPath,nodeOptions:M=B}=b;return execa(T,[...M,t,...Array.isArray(s)?s:[]],{...b,stdin:undefined,stdout:undefined,stderr:undefined,stdio:F,shell:false})}},4835:t=>{"use strict";const normalizeArgs=(t,s=[])=>{if(!Array.isArray(s)){return[t]}return[t,...s]};const s=/^[\w.-]+$/;const b=/"/g;const escapeArg=t=>{if(typeof t!=="string"||s.test(t)){return t}return`"${t.replace(b,'\\"')}"`};const joinCommand=(t,s)=>normalizeArgs(t,s).join(" ");const getEscapedCommand=(t,s)=>normalizeArgs(t,s).map((t=>escapeArg(t))).join(" ");const F=/ +/g;const parseCommand=t=>{const s=[];for(const b of t.trim().split(F)){const t=s[s.length-1];if(t&&t.endsWith("\\")){s[s.length-1]=`${t.slice(0,-1)} ${b}`}else{s.push(b)}}return s};t.exports={joinCommand:joinCommand,getEscapedCommand:getEscapedCommand,parseCommand:parseCommand}},8244:(t,s,b)=>{"use strict";const{signalsByName:F}=b(7976);const getErrorPrefix=({timedOut:t,timeout:s,errorCode:b,signal:F,signalDescription:B,exitCode:T,isCanceled:M})=>{if(t){return`timed out after ${s} milliseconds`}if(M){return"was canceled"}if(b!==undefined){return`failed with ${b}`}if(F!==undefined){return`was killed with ${F} (${B})`}if(T!==undefined){return`failed with exit code ${T}`}return"failed"};const makeError=({stdout:t,stderr:s,all:b,error:B,signal:T,exitCode:M,command:R,escapedCommand:U,timedOut:L,isCanceled:W,killed:K,parsed:{options:{timeout:z}}})=>{M=M===null?undefined:M;T=T===null?undefined:T;const G=T===undefined?undefined:F[T].description;const H=B&&B.code;const V=getErrorPrefix({timedOut:L,timeout:z,errorCode:H,signal:T,signalDescription:G,exitCode:M,isCanceled:W});const q=`Command ${V}: ${R}`;const J=Object.prototype.toString.call(B)==="[object Error]";const Y=J?`${q}\n${B.message}`:q;const X=[Y,s,t].filter(Boolean).join("\n");if(J){B.originalMessage=B.message;B.message=X}else{B=new Error(X)}B.shortMessage=Y;B.command=R;B.escapedCommand=U;B.exitCode=M;B.signal=T;B.signalDescription=G;B.stdout=t;B.stderr=s;if(b!==undefined){B.all=b}if("bufferedData"in B){delete B.bufferedData}B.failed=true;B.timedOut=Boolean(L);B.isCanceled=W;B.killed=K&&!L;return B};t.exports=makeError},5676:(t,s,b)=>{"use strict";const F=b(857);const B=b(1521);const T=1e3*5;const spawnedKill=(t,s="SIGTERM",b={})=>{const F=t(s);setKillTimeout(t,s,b,F);return F};const setKillTimeout=(t,s,b,F)=>{if(!shouldForceKill(s,b,F)){return}const B=getForceKillAfterTimeout(b);const T=setTimeout((()=>{t("SIGKILL")}),B);if(T.unref){T.unref()}};const shouldForceKill=(t,{forceKillAfterTimeout:s},b)=>isSigterm(t)&&s!==false&&b;const isSigterm=t=>t===F.constants.signals.SIGTERM||typeof t==="string"&&t.toUpperCase()==="SIGTERM";const getForceKillAfterTimeout=({forceKillAfterTimeout:t=true})=>{if(t===true){return T}if(!Number.isFinite(t)||t<0){throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)}return t};const spawnedCancel=(t,s)=>{const b=t.kill();if(b){s.isCanceled=true}};const timeoutKill=(t,s,b)=>{t.kill(s);b(Object.assign(new Error("Timed out"),{timedOut:true,signal:s}))};const setupTimeout=(t,{timeout:s,killSignal:b="SIGTERM"},F)=>{if(s===0||s===undefined){return F}let B;const T=new Promise(((F,T)=>{B=setTimeout((()=>{timeoutKill(t,b,T)}),s)}));const M=F.finally((()=>{clearTimeout(B)}));return Promise.race([T,M])};const validateTimeout=({timeout:t})=>{if(t!==undefined&&(!Number.isFinite(t)||t<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)}};const setExitHandler=async(t,{cleanup:s,detached:b},F)=>{if(!s||b){return F}const T=B((()=>{t.kill()}));return F.finally((()=>{T()}))};t.exports={spawnedKill:spawnedKill,spawnedCancel:spawnedCancel,setupTimeout:setupTimeout,validateTimeout:validateTimeout,setExitHandler:setExitHandler}},6163:t=>{"use strict";const s=(async()=>{})().constructor.prototype;const b=["then","catch","finally"].map((t=>[t,Reflect.getOwnPropertyDescriptor(s,t)]));const mergePromise=(t,s)=>{for(const[F,B]of b){const b=typeof s==="function"?(...t)=>Reflect.apply(B.value,s(),t):B.value.bind(s);Reflect.defineProperty(t,F,{...B,value:b})}return t};const getSpawnedPromise=t=>new Promise(((s,b)=>{t.on("exit",((t,b)=>{s({exitCode:t,signal:b})}));t.on("error",(t=>{b(t)}));if(t.stdin){t.stdin.on("error",(t=>{b(t)}))}}));t.exports={mergePromise:mergePromise,getSpawnedPromise:getSpawnedPromise}},9487:t=>{"use strict";const s=["stdin","stdout","stderr"];const hasAlias=t=>s.some((s=>t[s]!==undefined));const normalizeStdio=t=>{if(!t){return}const{stdio:b}=t;if(b===undefined){return s.map((s=>t[s]))}if(hasAlias(t)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${s.map((t=>`\`${t}\``)).join(", ")}`)}if(typeof b==="string"){return b}if(!Array.isArray(b)){throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof b}\``)}const F=Math.max(b.length,s.length);return Array.from({length:F},((t,s)=>b[s]))};t.exports=normalizeStdio;t.exports.node=t=>{const s=normalizeStdio(t);if(s==="ipc"){return"ipc"}if(s===undefined||typeof s==="string"){return[s,s,s,"ipc"]}if(s.includes("ipc")){return s}return[...s,"ipc"]}},7828:(t,s,b)=>{"use strict";const F=b(7277);const B=b(3221);const T=b(2993);const handleInput=(t,s)=>{if(s===undefined||t.stdin===undefined){return}if(F(s)){s.pipe(t.stdin)}else{t.stdin.end(s)}};const makeAllStream=(t,{all:s})=>{if(!s||!t.stdout&&!t.stderr){return}const b=T();if(t.stdout){b.add(t.stdout)}if(t.stderr){b.add(t.stderr)}return b};const getBufferedData=async(t,s)=>{if(!t){return}t.destroy();try{return await s}catch(t){return t.bufferedData}};const getStreamPromise=(t,{encoding:s,buffer:b,maxBuffer:F})=>{if(!t||!b){return}if(s){return B(t,{encoding:s,maxBuffer:F})}return B.buffer(t,{maxBuffer:F})};const getSpawnedResult=async({stdout:t,stderr:s,all:b},{encoding:F,buffer:B,maxBuffer:T},M)=>{const R=getStreamPromise(t,{encoding:F,buffer:B,maxBuffer:T});const U=getStreamPromise(s,{encoding:F,buffer:B,maxBuffer:T});const L=getStreamPromise(b,{encoding:F,buffer:B,maxBuffer:T*2});try{return await Promise.all([M,R,U,L])}catch(F){return Promise.all([{error:F,signal:F.signal,timedOut:F.timedOut},getBufferedData(t,R),getBufferedData(s,U),getBufferedData(b,L)])}};const validateInputSync=({input:t})=>{if(F(t)){throw new TypeError("The `input` option cannot be a stream in sync mode")}};t.exports={handleInput:handleInput,makeAllStream:makeAllStream,getSpawnedResult:getSpawnedResult,validateInputSync:validateInputSync}},1694:(t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:true});s.SIGNALS=void 0;const b=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:true},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];s.SIGNALS=b},7976:(t,s,b)=>{"use strict";Object.defineProperty(s,"__esModule",{value:true});s.signalsByNumber=s.signalsByName=void 0;var F=b(857);var B=b(5136);var T=b(968);const getSignalsByName=function(){const t=(0,B.getSignals)();return t.reduce(getSignalByName,{})};const getSignalByName=function(t,{name:s,number:b,description:F,supported:B,action:T,forced:M,standard:R}){return{...t,[s]:{name:s,number:b,description:F,supported:B,action:T,forced:M,standard:R}}};const M=getSignalsByName();s.signalsByName=M;const getSignalsByNumber=function(){const t=(0,B.getSignals)();const s=T.SIGRTMAX+1;const b=Array.from({length:s},((s,b)=>getSignalByNumber(b,t)));return Object.assign({},...b)};const getSignalByNumber=function(t,s){const b=findSignalByNumber(t,s);if(b===undefined){return{}}const{name:F,description:B,supported:T,action:M,forced:R,standard:U}=b;return{[t]:{name:F,number:t,description:B,supported:T,action:M,forced:R,standard:U}}};const findSignalByNumber=function(t,s){const b=s.find((({name:s})=>F.constants.signals[s]===t));if(b!==undefined){return b}return s.find((s=>s.number===t))};const R=getSignalsByNumber();s.signalsByNumber=R},968:(t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:true});s.SIGRTMAX=s.getRealtimeSignals=void 0;const getRealtimeSignals=function(){const t=F-b+1;return Array.from({length:t},getRealtimeSignal)};s.getRealtimeSignals=getRealtimeSignals;const getRealtimeSignal=function(t,s){return{name:`SIGRT${s+1}`,number:b+s,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}};const b=34;const F=64;s.SIGRTMAX=F},5136:(t,s,b)=>{"use strict";Object.defineProperty(s,"__esModule",{value:true});s.getSignals=void 0;var F=b(857);var B=b(1694);var T=b(968);const getSignals=function(){const t=(0,T.getRealtimeSignals)();const s=[...B.SIGNALS,...t].map(normalizeSignal);return s};s.getSignals=getSignals;const normalizeSignal=function({name:t,number:s,description:b,action:B,forced:T=false,standard:M}){const{signals:{[t]:R}}=F.constants;const U=R!==undefined;const L=U?R:s;return{name:t,number:L,description:b,supported:U,action:B,forced:T,standard:M}}},1521:(t,s,b)=>{var F=global.process;const processOk=function(t){return t&&typeof t==="object"&&typeof t.removeListener==="function"&&typeof t.emit==="function"&&typeof t.reallyExit==="function"&&typeof t.listeners==="function"&&typeof t.kill==="function"&&typeof t.pid==="number"&&typeof t.on==="function"};if(!processOk(F)){t.exports=function(){return function(){}}}else{var B=b(2613);var T=b(2280);var M=/^win/i.test(F.platform);var R=b(4434);if(typeof R!=="function"){R=R.EventEmitter}var U;if(F.__signal_exit_emitter__){U=F.__signal_exit_emitter__}else{U=F.__signal_exit_emitter__=new R;U.count=0;U.emitted={}}if(!U.infinite){U.setMaxListeners(Infinity);U.infinite=true}t.exports=function(t,s){if(!processOk(global.process)){return function(){}}B.equal(typeof t,"function","a callback must be provided for exit handler");if(z===false){G()}var b="exit";if(s&&s.alwaysLast){b="afterexit"}var remove=function(){U.removeListener(b,t);if(U.listeners("exit").length===0&&U.listeners("afterexit").length===0){L()}};U.on(b,t);return remove};var L=function unload(){if(!z||!processOk(global.process)){return}z=false;T.forEach((function(t){try{F.removeListener(t,K[t])}catch(t){}}));F.emit=q;F.reallyExit=H;U.count-=1};t.exports.unload=L;var W=function emit(t,s,b){if(U.emitted[t]){return}U.emitted[t]=true;U.emit(t,s,b)};var K={};T.forEach((function(t){K[t]=function listener(){if(!processOk(global.process)){return}var s=F.listeners(t);if(s.length===U.count){L();W("exit",null,t);W("afterexit",null,t);if(M&&t==="SIGHUP"){t="SIGINT"}F.kill(F.pid,t)}}}));t.exports.signals=function(){return T};var z=false;var G=function load(){if(z||!processOk(global.process)){return}z=true;U.count+=1;T=T.filter((function(t){try{F.on(t,K[t]);return true}catch(t){return false}}));F.emit=J;F.reallyExit=V};t.exports.load=G;var H=F.reallyExit;var V=function processReallyExit(t){if(!processOk(global.process)){return}F.exitCode=t||0;W("exit",F.exitCode,null);W("afterexit",F.exitCode,null);H.call(F,F.exitCode)};var q=F.emit;var J=function processEmit(t,s){if(t==="exit"&&processOk(global.process)){if(s!==undefined){F.exitCode=s}var b=q.apply(this,arguments);W("exit",F.exitCode,null);W("afterexit",F.exitCode,null);return b}else{return q.apply(this,arguments)}}}},2280:t=>{t.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){t.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){t.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},2740:t=>{"use strict";t.exports=t=>{const s=typeof t==="string"?"\n":"\n".charCodeAt();const b=typeof t==="string"?"\r":"\r".charCodeAt();if(t[t.length-1]===s){t=t.slice(0,t.length-1)}if(t[t.length-1]===b){t=t.slice(0,t.length-1)}return t}},9103:t=>{"use strict";t.exports=function getCallerFile(t){if(t===void 0){t=2}if(t>=Error.stackTraceLimit){throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+t+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`")}var s=Error.prepareStackTrace;Error.prepareStackTrace=function(t,s){return s};var b=(new Error).stack;Error.prepareStackTrace=s;if(b!==null&&typeof b==="object"){return b[t]?b[t].getFileName():undefined}}},324:(t,s,b)=>{"use strict";const{PassThrough:F}=b(2203);t.exports=t=>{t={...t};const{array:s}=t;let{encoding:b}=t;const B=b==="buffer";let T=false;if(s){T=!(b||B)}else{b=b||"utf8"}if(B){b=null}const M=new F({objectMode:T});if(b){M.setEncoding(b)}let R=0;const U=[];M.on("data",(t=>{U.push(t);if(T){R=U.length}else{R+=t.length}}));M.getBufferedValue=()=>{if(s){return U}return B?Buffer.concat(U,R):U.join("")};M.getBufferedLength=()=>R;return M}},3221:(t,s,b)=>{"use strict";const{constants:F}=b(181);const B=b(2203);const{promisify:T}=b(9023);const M=b(324);const R=T(B.pipeline);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(t,s){if(!t){throw new Error("Expected a stream")}s={maxBuffer:Infinity,...s};const{maxBuffer:b}=s;const B=M(s);await new Promise(((s,T)=>{const rejectPromise=t=>{if(t&&B.getBufferedLength()<=F.MAX_LENGTH){t.bufferedData=B.getBufferedValue()}T(t)};(async()=>{try{await R(t,B);s()}catch(t){rejectPromise(t)}})();B.on("data",(()=>{if(B.getBufferedLength()>b){rejectPromise(new MaxBufferError)}}))}));return B.getBufferedValue()}t.exports=getStream;t.exports.buffer=(t,s)=>getStream(t,{...s,encoding:"buffer"});t.exports.array=(t,s)=>getStream(t,{...s,array:true});t.exports.MaxBufferError=MaxBufferError},205:t=>{"use strict";const isFullwidthCodePoint=t=>{if(Number.isNaN(t)){return false}if(t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141)){return true}return false};t.exports=isFullwidthCodePoint;t.exports["default"]=isFullwidthCodePoint},7277:t=>{"use strict";const isStream=t=>t!==null&&typeof t==="object"&&typeof t.pipe==="function";isStream.writable=t=>isStream(t)&&t.writable!==false&&typeof t._write==="function"&&typeof t._writableState==="object";isStream.readable=t=>isStream(t)&&t.readable!==false&&typeof t._read==="function"&&typeof t._readableState==="object";isStream.duplex=t=>isStream.writable(t)&&isStream.readable(t);isStream.transform=t=>isStream.duplex(t)&&typeof t._transform==="function";t.exports=isStream},7210:(t,s,b)=>{var F=b(9896);var B;if(process.platform==="win32"||global.TESTING_WINDOWS){B=b(6431)}else{B=b(2891)}t.exports=isexe;isexe.sync=sync;function isexe(t,s,b){if(typeof s==="function"){b=s;s={}}if(!b){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(b,F){isexe(t,s||{},(function(t,s){if(t){F(t)}else{b(s)}}))}))}B(t,s||{},(function(t,F){if(t){if(t.code==="EACCES"||s&&s.ignoreErrors){t=null;F=false}}b(t,F)}))}function sync(t,s){try{return B.sync(t,s||{})}catch(t){if(s&&s.ignoreErrors||t.code==="EACCES"){return false}else{throw t}}}},2891:(t,s,b)=>{t.exports=isexe;isexe.sync=sync;var F=b(9896);function isexe(t,s,b){F.stat(t,(function(t,F){b(t,t?false:checkStat(F,s))}))}function sync(t,s){return checkStat(F.statSync(t),s)}function checkStat(t,s){return t.isFile()&&checkMode(t,s)}function checkMode(t,s){var b=t.mode;var F=t.uid;var B=t.gid;var T=s.uid!==undefined?s.uid:process.getuid&&process.getuid();var M=s.gid!==undefined?s.gid:process.getgid&&process.getgid();var R=parseInt("100",8);var U=parseInt("010",8);var L=parseInt("001",8);var W=R|U;var K=b&L||b&U&&B===M||b&R&&F===T||b&W&&T===0;return K}},6431:(t,s,b)=>{t.exports=isexe;isexe.sync=sync;var F=b(9896);function checkPathExt(t,s){var b=s.pathExt!==undefined?s.pathExt:process.env.PATHEXT;if(!b){return true}b=b.split(";");if(b.indexOf("")!==-1){return true}for(var F=0;F<b.length;F++){var B=b[F].toLowerCase();if(B&&t.substr(-B.length).toLowerCase()===B){return true}}return false}function checkStat(t,s,b){if(!t.isSymbolicLink()&&!t.isFile()){return false}return checkPathExt(s,b)}function isexe(t,s,b){F.stat(t,(function(F,B){b(F,F?false:checkStat(B,t,s))}))}function sync(t,s){return checkStat(F.statSync(t),t,s)}},2993:(t,s,b)=>{"use strict";const{PassThrough:F}=b(2203);t.exports=function(){var t=[];var s=new F({objectMode:true});s.setMaxListeners(0);s.add=add;s.isEmpty=isEmpty;s.on("unpipe",remove);Array.prototype.slice.call(arguments).forEach(add);return s;function add(b){if(Array.isArray(b)){b.forEach(add);return this}t.push(b);b.once("end",remove.bind(null,b));b.once("error",s.emit.bind(s,"error"));b.pipe(s,{end:false});return this}function isEmpty(){return t.length==0}function remove(b){t=t.filter((function(t){return t!==b}));if(!t.length&&s.readable){s.end()}}}},7221:(t,s,b)=>{"use strict";const F=b(6928);const B=b(8251);const npmRunPath=t=>{t={cwd:process.cwd(),path:process.env[B()],execPath:process.execPath,...t};let s;let b=F.resolve(t.cwd);const T=[];while(s!==b){T.push(F.join(b,"node_modules/.bin"));s=b;b=F.resolve(b,"..")}const M=F.resolve(t.cwd,t.execPath,"..");T.push(M);return T.concat(t.path).join(F.delimiter)};t.exports=npmRunPath;t.exports["default"]=npmRunPath;t.exports.env=s=>{s={env:process.env,...s};const b={...s.env};const F=B({env:b});s.path=b[F];b[F]=t.exports(s);return b}},163:(t,s,b)=>{"use strict";const F=b(7631);const B=new WeakMap;const onetime=(t,s={})=>{if(typeof t!=="function"){throw new TypeError("Expected a function")}let b;let T=0;const M=t.displayName||t.name||"<anonymous>";const onetime=function(...F){B.set(onetime,++T);if(T===1){b=t.apply(this,F);t=null}else if(s.throw===true){throw new Error(`Function \`${M}\` can only be called once`)}return b};F(onetime,t);B.set(onetime,T);return onetime};t.exports=onetime;t.exports["default"]=onetime;t.exports.callCount=t=>{if(!B.has(t)){throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`)}return B.get(t)}},7631:t=>{"use strict";const mimicFn=(t,s)=>{for(const b of Reflect.ownKeys(s)){Object.defineProperty(t,b,Object.getOwnPropertyDescriptor(s,b))}return t};t.exports=mimicFn;t.exports["default"]=mimicFn},8251:t=>{"use strict";const pathKey=(t={})=>{const s=t.env||process.env;const b=t.platform||process.platform;if(b!=="win32"){return"PATH"}return Object.keys(s).reverse().find((t=>t.toUpperCase()==="PATH"))||"Path"};t.exports=pathKey;t.exports["default"]=pathKey},763:(t,s,b)=>{"use strict";var F=b(9896),B=b(6928).join,T=b(6928).resolve,M=b(6928).dirname,R={extensions:["js","json","coffee"],recurse:true,rename:function(t){return t},visit:function(t){return t}};function checkFileInclusion(t,s,b){return new RegExp("\\.("+b.extensions.join("|")+")$","i").test(s)&&!(b.include&&b.include instanceof RegExp&&!b.include.test(t))&&!(b.include&&typeof b.include==="function"&&!b.include(t,s))&&!(b.exclude&&b.exclude instanceof RegExp&&b.exclude.test(t))&&!(b.exclude&&typeof b.exclude==="function"&&b.exclude(t,s))}function requireDirectory(t,s,b){var U={};if(s&&!b&&typeof s!=="string"){b=s;s=null}b=b||{};for(var L in R){if(typeof b[L]==="undefined"){b[L]=R[L]}}s=!s?M(t.filename):T(M(t.filename),s);F.readdirSync(s).forEach((function(T){var M=B(s,T),R,L,W;if(F.statSync(M).isDirectory()&&b.recurse){R=requireDirectory(t,M,b);if(Object.keys(R).length){U[b.rename(T,M,T)]=R}}else{if(M!==t.filename&&checkFileInclusion(M,T,b)){L=T.substring(0,T.lastIndexOf("."));W=t.require(M);U[b.rename(L,M,T)]=b.visit(W,M,T)||W}}}));return U}t.exports=requireDirectory;t.exports.defaults=R},934:(t,s,b)=>{"use strict";const F=b(1368);t.exports=(t="")=>{const s=t.match(F);if(!s){return null}const[b,B]=s[0].replace(/#! ?/,"").split(" ");const T=b.split("/").pop();if(T==="env"){return B}return B?`${T} ${B}`:T}},1368:t=>{"use strict";t.exports=/^#!(.*)/},1838:(t,s,b)=>{"use strict";const F=b(764);const B=b(205);const T=b(3718);const stringWidth=t=>{if(typeof t!=="string"||t.length===0){return 0}t=F(t);if(t.length===0){return 0}t=t.replace(T()," ");let s=0;for(let b=0;b<t.length;b++){const F=t.codePointAt(b);if(F<=31||F>=127&&F<=159){continue}if(F>=768&&F<=879){continue}if(F>65535){b++}s+=B(F)?2:1}return s};t.exports=stringWidth;t.exports["default"]=stringWidth},3718:t=>{"use strict";t.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}},764:(t,s,b)=>{"use strict";const F=b(8587);t.exports=t=>typeof t==="string"?t.replace(F(),""):t},1719:(t,s,b)=>{"use strict";b.a(t,(async(t,F)=>{try{b.r(s);var B=b(5317);var T=b.n(B);var M=b(1943);var R=b.n(M);var U=b(9309);var L=b(222);var W=b(2142);const prepare=async()=>{await R().access("src").catch((()=>{throw new Error("src directory not found. Make sure all your source code is in the src directory.")}));await R().access("src/pages").then((()=>{throw new Error("pages directory found. Only NextJS App Router is supported. Convert your app to use App Router and delete the pages directory.")})).catch((()=>{}));await R().rm("src/app/mavenagi-cgi",{recursive:true,force:true});await R().mkdir("src/app/mavenagi-cgi",{recursive:true});await Promise.all([R().writeFile("src/app/mavenagi-cgi/next.ts",`// @ts-nocheck\n${W.S}`),...Object.entries({"pre-install":"preInstall","post-install":"postInstall",feedbacks:"feedbackCreatedOrUpdated",conversations:"conversationCreatedOrUpdated","execute-action":"executeAction","knowledge-base-refreshed":"knowledgeBaseRefreshed"}).map((async([t,s])=>{await R().mkdir(`src/app/mavenagi-cgi/v1/${t}`,{recursive:true});const b=await R().readFile(`src/index.ts`,"utf8");const F=b.includes("export const runtime = 'edge'")||b.includes('export const runtime = "edge"');if(F){throw new Error("Edge runtime is no longer supported. Remove the runtime export from index.ts.")}await R().writeFile(`src/app/mavenagi-cgi/v1/${t}/route.ts`,`// @ts-nocheck\nimport {${s}} from '../../next'\nimport userWorker from '../../../..'\n\nexport const POST = ${s}\n`)}))])};await(0,L.A)(process.argv.slice(2)).scriptName("mavenagi").usage("$0 <cmd> [args]").command("build","build",(async()=>{await prepare();(0,B.execFileSync)(await(0,U.o0)(),["run","build"],{stdio:"inherit"});process.exit(0)})).command("dev","dev",(async()=>{await prepare();(0,B.execFileSync)(await(0,U.o0)(),["run","dev"],{stdio:"inherit"});process.exit(0)})).help().argv;F()}catch(t){F(t)}}),1)},2142:(t,s,b)=>{"use strict";b.d(s,{S:()=>F});const F=`var to=Object.defineProperty;var no=(e,r)=>{for(var t in r)to(e,t,{get:r[t],enumerable:!0})};var X=new TextEncoder,M=new TextDecoder,Sa=2**32;function Br(...e){let r=e.reduce((i,{length:a})=>i+a,0),t=new Uint8Array(r),n=0;for(let i of e)t.set(i,n),n+=i.length;return t}function Mr(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let r=atob(e),t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r.charCodeAt(n);return t}function L(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e=="string"?e:M.decode(e),{alphabet:"base64url"});let r=e;r instanceof Uint8Array&&(r=M.decode(r)),r=r.replace(/-/g,"+").replace(/_/g,"/").replace(/\\s/g,"");try{return Mr(r)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}var P=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(r,t){super(r,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},j=class extends P{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(r,t,n="unspecified",i="unspecified"){super(r,{cause:{claim:n,reason:i,payload:t}}),this.claim=n,this.reason=i,this.payload=t}},ce=class extends P{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(r,t,n="unspecified",i="unspecified"){super(r,{cause:{claim:n,reason:i,payload:t}}),this.claim=n,this.reason=i,this.payload=t}},Pe=class extends P{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},A=class extends P{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};var S=class extends P{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},Y=class extends P{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"};var ue=class extends P{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},Q=class extends P{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(r="no applicable key found in the JSON Web Key Set",t){super(r,t)}},Ae=class extends P{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(r="multiple matching keys found in the JSON Web Key Set",t){super(r,t)}},Ie=class extends P{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(r="request timed out",t){super(r,t)}},ze=class extends P{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(r="signature verification failed",t){super(r,t)}};function W(e,r="algorithm.name"){return new TypeError(\`CryptoKey does not support this operation, its \${r} must be \${e}\`)}function fe(e,r){return e.name===r}function nr(e){return parseInt(e.name.slice(4),10)}function ao(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function so(e,r){if(r&&!e.usages.includes(r))throw new TypeError(\`CryptoKey does not support this operation, its usages must include \${r}.\`)}function Wr(e,r,t){switch(r){case"HS256":case"HS384":case"HS512":{if(!fe(e.algorithm,"HMAC"))throw W("HMAC");let n=parseInt(r.slice(2),10);if(nr(e.algorithm.hash)!==n)throw W(\`SHA-\${n}\`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!fe(e.algorithm,"RSASSA-PKCS1-v1_5"))throw W("RSASSA-PKCS1-v1_5");let n=parseInt(r.slice(2),10);if(nr(e.algorithm.hash)!==n)throw W(\`SHA-\${n}\`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!fe(e.algorithm,"RSA-PSS"))throw W("RSA-PSS");let n=parseInt(r.slice(2),10);if(nr(e.algorithm.hash)!==n)throw W(\`SHA-\${n}\`,"algorithm.hash");break}case"Ed25519":case"EdDSA":{if(!fe(e.algorithm,"Ed25519"))throw W("Ed25519");break}case"ES256":case"ES384":case"ES512":{if(!fe(e.algorithm,"ECDSA"))throw W("ECDSA");let n=ao(r);if(e.algorithm.namedCurve!==n)throw W(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}so(e,t)}function Lr(e,r,...t){if(t=t.filter(Boolean),t.length>2){let n=t.pop();e+=\`one of type \${t.join(", ")}, or \${n}.\`}else t.length===2?e+=\`one of type \${t[0]} or \${t[1]}.\`:e+=\`of type \${t[0]}.\`;return r==null?e+=\` Received \${r}\`:typeof r=="function"&&r.name?e+=\` Received function \${r.name}\`:typeof r=="object"&&r!=null&&r.constructor?.name&&(e+=\` Received an instance of \${r.constructor.name}\`),e}var Jr=(e,...r)=>Lr("Key must be ",e,...r);function or(e,r,...t){return Lr(\`Key for the \${e} algorithm must be \`,r,...t)}function ir(e){return e?.[Symbol.toStringTag]==="CryptoKey"}function ar(e){return e?.[Symbol.toStringTag]==="KeyObject"}var sr=e=>ir(e)||ar(e);var Fr=(...e)=>{let r=e.filter(Boolean);if(r.length===0||r.length===1)return!0;let t;for(let n of r){let i=Object.keys(n);if(!t||t.size===0){t=new Set(i);continue}for(let a of i){if(t.has(a))return!1;t.add(a)}}return!0};function co(e){return typeof e=="object"&&e!==null}var T=e=>{if(!co(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r};var Vr=(e,r)=>{if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:t}=r.algorithm;if(typeof t!="number"||t<2048)throw new TypeError(\`\${e} requires key modulusLength to be 2048 bits or larger\`)}};function uo(e){let r,t;switch(e.kty){case"RSA":{switch(e.alg){case"PS256":case"PS384":case"PS512":r={name:"RSA-PSS",hash:\`SHA-\${e.alg.slice(-3)}\`},t=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":r={name:"RSASSA-PKCS1-v1_5",hash:\`SHA-\${e.alg.slice(-3)}\`},t=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":r={name:"RSA-OAEP",hash:\`SHA-\${parseInt(e.alg.slice(-3),10)||1}\`},t=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new A('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(e.alg){case"ES256":r={name:"ECDSA",namedCurve:"P-256"},t=e.d?["sign"]:["verify"];break;case"ES384":r={name:"ECDSA",namedCurve:"P-384"},t=e.d?["sign"]:["verify"];break;case"ES512":r={name:"ECDSA",namedCurve:"P-521"},t=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":r={name:"ECDH",namedCurve:e.crv},t=e.d?["deriveBits"]:[];break;default:throw new A('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(e.alg){case"Ed25519":case"EdDSA":r={name:"Ed25519"},t=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":r={name:e.crv},t=e.d?["deriveBits"]:[];break;default:throw new A('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new A('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:r,keyUsages:t}}var Te=async e=>{if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:r,keyUsages:t}=uo(e),n={...e};return delete n.alg,delete n.use,crypto.subtle.importKey("jwk",n,r,e.ext??!e.d,e.key_ops??t)};async function Hr(e,r,t){if(!T(e))throw new TypeError("JWK must be an object");let n;switch(r??=e.alg,n??=t?.extractable??e.ext,e.kty){case"oct":if(typeof e.k!="string"||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return L(e.k);case"RSA":if("oth"in e&&e.oth!==void 0)throw new A('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return Te({...e,alg:r,ext:n});default:throw new A('Unsupported "kty" (Key Type) Parameter value')}}var Gr=(e,r,t,n,i)=>{if(i.crit!==void 0&&n?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||n.crit===void 0)return new Set;if(!Array.isArray(n.crit)||n.crit.length===0||n.crit.some(c=>typeof c!="string"||c.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let a;t!==void 0?a=new Map([...Object.entries(t),...r.entries()]):a=r;for(let c of n.crit){if(!a.has(c))throw new A(\`Extension Header Parameter "\${c}" is not recognized\`);if(i[c]===void 0)throw new e(\`Extension Header Parameter "\${c}" is missing\`);if(a.get(c)&&n[c]===void 0)throw new e(\`Extension Header Parameter "\${c}" MUST be integrity protected\`)}return new Set(n.crit)};var $r=(e,r)=>{if(r!==void 0&&(!Array.isArray(r)||r.some(t=>typeof t!="string")))throw new TypeError(\`"\${e}" option must be an array of strings\`);if(r)return new Set(r)};function le(e){return T(e)&&typeof e.kty=="string"}function qr(e){return e.kty!=="oct"&&typeof e.d=="string"}function Xr(e){return e.kty!=="oct"&&typeof e.d>"u"}function Yr(e){return e.kty==="oct"&&typeof e.k=="string"}var Z,Qr=async(e,r,t,n=!1)=>{Z||=new WeakMap;let i=Z.get(e);if(i?.[t])return i[t];let a=await Te({...r,alg:t});return n&&Object.freeze(e),i?i[t]=a:Z.set(e,{[t]:a}),a},lo=(e,r)=>{Z||=new WeakMap;let t=Z.get(e);if(t?.[r])return t[r];let n=e.type==="public",i=!!n,a;if(e.asymmetricKeyType==="x25519"){switch(r){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}a=e.toCryptoKey(e.asymmetricKeyType,i,n?[]:["deriveBits"])}if(e.asymmetricKeyType==="ed25519"){if(r!=="EdDSA"&&r!=="Ed25519")throw new TypeError("given KeyObject instance cannot be used for this algorithm");a=e.toCryptoKey(e.asymmetricKeyType,i,[n?"verify":"sign"])}if(e.asymmetricKeyType==="rsa"){let c;switch(r){case"RSA-OAEP":c="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":c="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":c="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":c="SHA-512";break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}if(r.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:c},i,n?["encrypt"]:["decrypt"]);a=e.toCryptoKey({name:r.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:c},i,[n?"verify":"sign"])}if(e.asymmetricKeyType==="ec"){let s=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!s)throw new TypeError("given KeyObject instance cannot be used for this algorithm");r==="ES256"&&s==="P-256"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:s},i,[n?"verify":"sign"])),r==="ES384"&&s==="P-384"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:s},i,[n?"verify":"sign"])),r==="ES512"&&s==="P-521"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:s},i,[n?"verify":"sign"])),r.startsWith("ECDH-ES")&&(a=e.toCryptoKey({name:"ECDH",namedCurve:s},i,n?[]:["deriveBits"]))}if(!a)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return t?t[r]=a:Z.set(e,{[r]:a}),a},Zr=async(e,r)=>{if(e instanceof Uint8Array||ir(e))return e;if(ar(e)){if(e.type==="secret")return e.export();if("toCryptoKey"in e&&typeof e.toCryptoKey=="function")try{return lo(e,r)}catch(n){if(n instanceof TypeError)throw n}let t=e.export({format:"jwk"});return Qr(e,t,r)}if(le(e))return e.k?L(e.k):Qr(e,e,r,!0);throw new Error("unreachable")};var ee=e=>e?.[Symbol.toStringTag],cr=(e,r,t)=>{if(r.use!==void 0){let n;switch(t){case"sign":case"verify":n="sig";break;case"encrypt":case"decrypt":n="enc";break}if(r.use!==n)throw new TypeError(\`Invalid key for this operation, its "use" must be "\${n}" when present\`)}if(r.alg!==void 0&&r.alg!==e)throw new TypeError(\`Invalid key for this operation, its "alg" must be "\${e}" when present\`);if(Array.isArray(r.key_ops)){let n;switch(!0){case(t==="sign"||t==="verify"):case e==="dir":case e.includes("CBC-HS"):n=t;break;case e.startsWith("PBES2"):n="deriveBits";break;case/^A\\d{3}(?:GCM)?(?:KW)?$/.test(e):!e.includes("GCM")&&e.endsWith("KW")?n=t==="encrypt"?"wrapKey":"unwrapKey":n=t;break;case(t==="encrypt"&&e.startsWith("RSA")):n="wrapKey";break;case t==="decrypt":n=e.startsWith("RSA")?"unwrapKey":"deriveBits";break}if(n&&r.key_ops?.includes?.(n)===!1)throw new TypeError(\`Invalid key for this operation, its "key_ops" must include "\${n}" when present\`)}return!0},po=(e,r,t)=>{if(!(r instanceof Uint8Array)){if(le(r)){if(Yr(r)&&cr(e,r,t))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!sr(r))throw new TypeError(or(e,r,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(r.type!=="secret")throw new TypeError(\`\${ee(r)} instances for symmetric algorithms must be of type "secret"\`)}},mo=(e,r,t)=>{if(le(r))switch(t){case"decrypt":case"sign":if(qr(r)&&cr(e,r,t))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"encrypt":case"verify":if(Xr(r)&&cr(e,r,t))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!sr(r))throw new TypeError(or(e,r,"CryptoKey","KeyObject","JSON Web Key"));if(r.type==="secret")throw new TypeError(\`\${ee(r)} instances for asymmetric algorithms must not be of type "secret"\`);if(r.type==="public")switch(t){case"sign":throw new TypeError(\`\${ee(r)} instances for asymmetric algorithm signing must be of type "private"\`);case"decrypt":throw new TypeError(\`\${ee(r)} instances for asymmetric algorithm decryption must be of type "private"\`);default:break}if(r.type==="private")switch(t){case"verify":throw new TypeError(\`\${ee(r)} instances for asymmetric algorithm verifying must be of type "public"\`);case"encrypt":throw new TypeError(\`\${ee(r)} instances for asymmetric algorithm encryption must be of type "public"\`);default:break}},et=(e,r,t)=>{e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(e)||/^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(e)?po(e,r,t):mo(e,r,t)};var rt=(e,r)=>{let t=\`SHA-\${e.slice(-3)}\`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:t,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:t,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:t,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:t,name:"ECDSA",namedCurve:r.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};default:throw new A(\`alg \${e} is not supported either by JOSE or your javascript runtime\`)}};var tt=async(e,r,t)=>{if(r instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(Jr(r,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",r,{hash:\`SHA-\${e.slice(-3)}\`,name:"HMAC"},!1,[t])}return Wr(r,e,t),r};var nt=async(e,r,t,n)=>{let i=await tt(e,r,"verify");Vr(e,i);let a=rt(e,i.algorithm);try{return await crypto.subtle.verify(a,i,t,n)}catch{return!1}};async function ot(e,r,t){if(!T(e))throw new S("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new S('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new S("JWS Protected Header incorrect type");if(e.payload===void 0)throw new S("JWS Payload missing");if(typeof e.signature!="string")throw new S("JWS Signature missing or incorrect type");if(e.header!==void 0&&!T(e.header))throw new S("JWS Unprotected Header incorrect type");let n={};if(e.protected)try{let E=L(e.protected);n=JSON.parse(M.decode(E))}catch{throw new S("JWS Protected Header is invalid")}if(!Fr(n,e.header))throw new S("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let i={...n,...e.header},a=Gr(S,new Map([["b64",!0]]),t?.crit,n,i),c=!0;if(a.has("b64")&&(c=n.b64,typeof c!="boolean"))throw new S('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=i;if(typeof s!="string"||!s)throw new S('JWS "alg" (Algorithm) Header Parameter missing or invalid');let l=t&&$r("algorithms",t.algorithms);if(l&&!l.has(s))throw new Pe('"alg" (Algorithm) Header Parameter value not allowed');if(c){if(typeof e.payload!="string")throw new S("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new S("JWS Payload must be a string or an Uint8Array instance");let f=!1;typeof r=="function"&&(r=await r(n,e),f=!0),et(s,r,"verify");let p=Br(X.encode(e.protected??""),X.encode("."),typeof e.payload=="string"?X.encode(e.payload):e.payload),d;try{d=L(e.signature)}catch{throw new S("Failed to base64url decode the signature")}let _=await Zr(r,s);if(!await nt(s,_,d,p))throw new ze;let y;if(c)try{y=L(e.payload)}catch{throw new S("Failed to base64url decode the payload")}else typeof e.payload=="string"?y=X.encode(e.payload):y=e.payload;let h={payload:y};return e.protected!==void 0&&(h.protectedHeader=n),e.header!==void 0&&(h.unprotectedHeader=e.header),f?{...h,key:_}:h}async function it(e,r,t){if(e instanceof Uint8Array&&(e=M.decode(e)),typeof e!="string")throw new S("Compact JWS must be a string or Uint8Array");let{0:n,1:i,2:a,length:c}=e.split(".");if(c!==3)throw new S("Invalid Compact JWS");let s=await ot({payload:i,protected:n,signature:a},r,t),l={payload:s.payload,protectedHeader:s.protectedHeader};return typeof r=="function"?{...l,key:s.key}:l}var at=e=>Math.floor(e.getTime()/1e3);var yo=/^(\\+|\\-)? ?(\\d+|\\d+\\.\\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,ur=e=>{let r=yo.exec(e);if(!r||r[4]&&r[1])throw new TypeError("Invalid time period format");let t=parseFloat(r[2]),n=r[3].toLowerCase(),i;switch(n){case"sec":case"secs":case"second":case"seconds":case"s":i=Math.round(t);break;case"minute":case"minutes":case"min":case"mins":case"m":i=Math.round(t*60);break;case"hour":case"hours":case"hr":case"hrs":case"h":i=Math.round(t*3600);break;case"day":case"days":case"d":i=Math.round(t*86400);break;case"week":case"weeks":case"w":i=Math.round(t*604800);break;default:i=Math.round(t*31557600);break}return r[1]==="-"||r[4]==="ago"?-i:i};var st=e=>e.toLowerCase().replace(/^application\\//,""),bo=(e,r)=>typeof e=="string"?r.includes(e):Array.isArray(e)?r.some(Set.prototype.has.bind(new Set(e))):!1,ct=(e,r,t={})=>{let n;try{n=JSON.parse(M.decode(r))}catch{}if(!T(n))throw new Y("JWT Claims Set must be a top-level JSON object");let{typ:i}=t;if(i&&(typeof e.typ!="string"||st(e.typ)!==st(i)))throw new j('unexpected "typ" JWT header value',n,"typ","check_failed");let{requiredClaims:a=[],issuer:c,subject:s,audience:l,maxTokenAge:f}=t,p=[...a];f!==void 0&&p.push("iat"),l!==void 0&&p.push("aud"),s!==void 0&&p.push("sub"),c!==void 0&&p.push("iss");for(let y of new Set(p.reverse()))if(!(y in n))throw new j(\`missing required "\${y}" claim\`,n,y,"missing");if(c&&!(Array.isArray(c)?c:[c]).includes(n.iss))throw new j('unexpected "iss" claim value',n,"iss","check_failed");if(s&&n.sub!==s)throw new j('unexpected "sub" claim value',n,"sub","check_failed");if(l&&!bo(n.aud,typeof l=="string"?[l]:l))throw new j('unexpected "aud" claim value',n,"aud","check_failed");let d;switch(typeof t.clockTolerance){case"string":d=ur(t.clockTolerance);break;case"number":d=t.clockTolerance;break;case"undefined":d=0;break;default:throw new TypeError("Invalid clockTolerance option type")}let{currentDate:_}=t,b=at(_||new Date);if((n.iat!==void 0||f)&&typeof n.iat!="number")throw new j('"iat" claim must be a number',n,"iat","invalid");if(n.nbf!==void 0){if(typeof n.nbf!="number")throw new j('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>b+d)throw new j('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(n.exp!==void 0){if(typeof n.exp!="number")throw new j('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=b-d)throw new ce('"exp" claim timestamp check failed',n,"exp","check_failed")}if(f){let y=b-n.iat,h=typeof f=="number"?f:ur(f);if(y-d>h)throw new ce('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(y<0-d)throw new j('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n};async function fr(e,r,t){let n=await it(e,r,t);if(n.protectedHeader.crit?.includes("b64")&&n.protectedHeader.b64===!1)throw new Y("JWTs MUST NOT use unencoded payload");let a={payload:ct(n.protectedHeader,n.payload,t),protectedHeader:n.protectedHeader};return typeof r=="function"?{...a,key:n.key}:a}function ho(e){switch(typeof e=="string"&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new A('Unsupported "alg" value for a JSON Web Key Set')}}function go(e){return e&&typeof e=="object"&&Array.isArray(e.keys)&&e.keys.every(vo)}function vo(e){return T(e)}function ft(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}var lr=class{_jwks;_cached=new WeakMap;constructor(r){if(!go(r))throw new ue("JSON Web Key Set malformed");this._jwks=ft(r)}async getKey(r,t){let{alg:n,kid:i}={...r,...t?.header},a=ho(n),c=this._jwks.keys.filter(f=>{let p=a===f.kty;if(p&&typeof i=="string"&&(p=i===f.kid),p&&typeof f.alg=="string"&&(p=n===f.alg),p&&typeof f.use=="string"&&(p=f.use==="sig"),p&&Array.isArray(f.key_ops)&&(p=f.key_ops.includes("verify")),p)switch(n){case"ES256":p=f.crv==="P-256";break;case"ES384":p=f.crv==="P-384";break;case"ES512":p=f.crv==="P-521";break;case"Ed25519":case"EdDSA":p=f.crv==="Ed25519";break}return p}),{0:s,length:l}=c;if(l===0)throw new Q;if(l!==1){let f=new Ae,{_cached:p}=this;throw f[Symbol.asyncIterator]=async function*(){for(let d of c)try{yield await ut(p,d,n)}catch{}},f}return ut(this._cached,s,n)}};async function ut(e,r,t){let n=e.get(r)||e.set(r,{}).get(r);if(n[t]===void 0){let i=await Hr({...r,ext:!0},t);if(i instanceof Uint8Array||i.type!=="public")throw new ue("JSON Web Key Set members must be public keys");n[t]=i}return n[t]}function pr(e){let r=new lr(e),t=async(n,i)=>r.getKey(n,i);return Object.defineProperties(t,{jwks:{value:()=>ft(r._jwks),enumerable:!0,configurable:!1,writable:!1}}),t}function _o(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}var mr;(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(mr="jose/v6.0.8");var pe=Symbol();async function xo(e,r,t,n=fetch){let i=await n(e,{method:"GET",signal:t,redirect:"manual",headers:r}).catch(a=>{throw a.name==="TimeoutError"?new Ie:a});if(i.status!==200)throw new P("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch{throw new P("Failed to parse the JSON Web Key Set HTTP response as JSON")}}var Re=Symbol();function wo(e,r){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=r||!("jwks"in e)||!T(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,T))}var dr=class{_url;_timeoutDuration;_cooldownDuration;_cacheMaxAge;_jwksTimestamp;_pendingFetch;_headers;[pe];_local;_cache;constructor(r,t){if(!(r instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(r.href),this._timeoutDuration=typeof t?.timeoutDuration=="number"?t?.timeoutDuration:5e3,this._cooldownDuration=typeof t?.cooldownDuration=="number"?t?.cooldownDuration:3e4,this._cacheMaxAge=typeof t?.cacheMaxAge=="number"?t?.cacheMaxAge:6e5,this._headers=new Headers(t?.headers),mr&&!this._headers.has("User-Agent")&&this._headers.set("User-Agent",mr),this._headers.has("accept")||(this._headers.set("accept","application/json"),this._headers.append("accept","application/jwk-set+json")),this[pe]=t?.[pe],t?.[Re]!==void 0&&(this._cache=t?.[Re],wo(t?.[Re],this._cacheMaxAge)&&(this._jwksTimestamp=this._cache.uat,this._local=pr(this._cache.jwks)))}coolingDown(){return typeof this._jwksTimestamp=="number"?Date.now()<this._jwksTimestamp+this._cooldownDuration:!1}fresh(){return typeof this._jwksTimestamp=="number"?Date.now()<this._jwksTimestamp+this._cacheMaxAge:!1}async getKey(r,t){(!this._local||!this.fresh())&&await this.reload();try{return await this._local(r,t)}catch(n){if(n instanceof Q&&this.coolingDown()===!1)return await this.reload(),this._local(r,t);throw n}}async reload(){this._pendingFetch&&_o()&&(this._pendingFetch=void 0),this._pendingFetch||=xo(this._url.href,this._headers,AbortSignal.timeout(this._timeoutDuration),this[pe]).then(r=>{this._local=pr(r),this._cache&&(this._cache.uat=Date.now(),this._cache.jwks=r),this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(r=>{throw this._pendingFetch=void 0,r}),await this._pendingFetch}};function yr(e,r){let t=new dr(e,r),n=async(i,a)=>t.getKey(i,a);return Object.defineProperties(n,{coolingDown:{get:()=>t.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>t.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>t.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>!!t._pendingFetch,enumerable:!0,configurable:!1},jwks:{value:()=>t._local?.jwks(),enumerable:!0,configurable:!1,writable:!1}}),n}function So(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}var br=Eo();function Eo(){var e,r,t,n,i,a,c,s,l=typeof window<"u"&&typeof window.document<"u";if(l)return{type:"browser",version:window.navigator.userAgent};var f=typeof globalThis<"u"&&((r=globalThis)===null||r===void 0||(e=r.navigator)===null||e===void 0?void 0:e.userAgent)==="Cloudflare-Workers";if(f)return{type:"workerd"};var p=typeof EdgeRuntime=="string";if(p)return{type:"edge-runtime"};var d=(typeof self>"u"?"undefined":So(self))==="object"&&typeof((t=self)===null||t===void 0?void 0:t.importScripts)=="function"&&(((n=self.constructor)===null||n===void 0?void 0:n.name)==="DedicatedWorkerGlobalScope"||((i=self.constructor)===null||i===void 0?void 0:i.name)==="ServiceWorkerGlobalScope"||((a=self.constructor)===null||a===void 0?void 0:a.name)==="SharedWorkerGlobalScope");if(d)return{type:"web-worker"};var _=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";if(_)return{type:"deno",version:Deno.version.deno};var b=typeof Bun<"u"&&typeof Bun.version<"u";if(b)return{type:"bun",version:Bun.version};var y=typeof process<"u"&&"version"in process&&!!process.version&&"versions"in process&&!!(!((c=process.versions)===null||c===void 0)&&c.node);if(y)return{type:"node",version:process.versions.node,parsedVersion:Number(process.versions.node.split(".")[0])};var h=typeof navigator<"u"&&((s=navigator)===null||s===void 0?void 0:s.product)==="ReactNative";return h?{type:"react-native"}:{type:"unknown"}}var o={};no(o,{JsonError:()=>De,ParseError:()=>Ue,any:()=>kt,bigint:()=>dt,boolean:()=>Dt,booleanLiteral:()=>jt,date:()=>yt,discriminant:()=>Gt,enum_:()=>Ne,getObjectLikeUtils:()=>C,getObjectUtils:()=>G,getSchemaUtils:()=>v,isProperty:()=>F,lazy:()=>bt,lazyObject:()=>It,list:()=>Me,number:()=>Kt,object:()=>Be,objectWithoutOptionalProperties:()=>Pt,optional:()=>wr,property:()=>xt,record:()=>Wt,set:()=>Lt,string:()=>Ut,stringLiteral:()=>Rt,transform:()=>Sr,undiscriminatedUnion:()=>Ht,union:()=>qt,unknown:()=>Ct,withParsedProperties:()=>Pr});var m={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"};function Po(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function lt(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function g(e,r){return"Expected ".concat(r,". Received ").concat(Ao(e),".")}function Ao(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(Po(e,BigInt))return"BigInt";switch(typeof e>"u"?"undefined":lt(e)){case"string":return'"'.concat(e,'"');case"bigint":case"number":case"boolean":case"undefined":return"".concat(e)}return typeof e>"u"?"undefined":lt(e)}function hr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Io(e){if(Array.isArray(e))return hr(e)}function zo(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function To(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ro(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function jo(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){zo(e,i,t[i])})}return e}function ko(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Do(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ko(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Ko(e){return Io(e)||To(e)||Uo(e)||Ro()}function Uo(e,r){if(e){if(typeof e=="string")return hr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return hr(e,r)}}function O(e){return Do(jo({},e),{json:pt(e.json),parse:pt(e.parse)})}function pt(e){return function(r,t){var n=e(r,t),i=t??{},a=i.skipValidation,c=a===void 0?!1:a;return!n.ok&&c?(console.warn(["Failed to validate."].concat(Ko(n.errors.map(function(s){return" - "+(s.path.length>0?"".concat(s.path.join("."),": ").concat(s.message):s.message)}))).join(\`\n\`)),{ok:!0,value:r}):n}}function je(e){return e.path.length===0?e.message:"".concat(e.path.join(" -> "),": ").concat(e.message)}function Co(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function No(e,r,t){return r=me(r),Jo(e,vr()?Reflect.construct(r,t||[],me(e).constructor):r.apply(e,t))}function Bo(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function ke(e,r,t){return vr()?ke=Reflect.construct:ke=function(i,a,c){var s=[null];s.push.apply(s,a);var l=Function.bind.apply(i,s),f=new l;return c&&de(f,c.prototype),f},ke.apply(null,arguments)}function Mo(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function me(e){return me=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},me(e)}function Wo(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&de(e,r)}function Lo(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Jo(e,r){return r&&(Fo(r)==="object"||typeof r=="function")?r:Co(e)}function de(e,r){return de=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},de(e,r)}function Fo(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function gr(e){var r=typeof Map=="function"?new Map:void 0;return gr=function(n){if(n===null||!Lo(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,i)}function i(){return ke(n,arguments,me(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),de(i,n)},gr(e)}function vr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vr=function(){return!!e})()}var De=function(e){"use strict";Wo(r,e);function r(t){Bo(this,r);var n;return n=No(this,r,[t.map(je).join("; ")]),Mo(n,"errors",void 0),n.errors=t,Object.setPrototypeOf(n,r.prototype),n}return r}(gr(Error));function Vo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ho(e,r,t){return r=ye(r),Yo(e,xr()?Reflect.construct(r,t||[],ye(e).constructor):r.apply(e,t))}function Go(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Ke(e,r,t){return xr()?Ke=Reflect.construct:Ke=function(i,a,c){var s=[null];s.push.apply(s,a);var l=Function.bind.apply(i,s),f=new l;return c&&be(f,c.prototype),f},Ke.apply(null,arguments)}function $o(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ye(e){return ye=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ye(e)}function qo(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&be(e,r)}function Xo(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Yo(e,r){return r&&(Qo(r)==="object"||typeof r=="function")?r:Vo(e)}function be(e,r){return be=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},be(e,r)}function Qo(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function _r(e){var r=typeof Map=="function"?new Map:void 0;return _r=function(n){if(n===null||!Xo(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,i)}function i(){return Ke(n,arguments,ye(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),be(i,n)},_r(e)}function xr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xr=function(){return!!e})()}var Ue=function(e){"use strict";qo(r,e);function r(t){Go(this,r);var n;return n=Ho(this,r,[t.map(je).join("; ")]),$o(n,"errors",void 0),n.errors=t,Object.setPrototypeOf(n,r.prototype),n}return r}(_r(Error));function Zo(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ce(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Zo(e,i,t[i])})}return e}function v(e){return{nullable:function(){return ei(e)},optional:function(){return wr(e)},optionalNullable:function(){return ri(e)},transform:function(r){return Sr(e,r)},parseOrThrow:function(r,t){var n=e.parse(r,t);if(n.ok)return n.value;throw new Ue(n.errors)},jsonOrThrow:function(r,t){var n=e.json(r,t);if(n.ok)return n.value;throw new De(n.errors)}}}function ei(e){var r={parse:function(t,n){return t==null?{ok:!0,value:null}:e.parse(t,n)},json:function(t,n){return t==null?{ok:!0,value:null}:e.json(t,n)},getType:function(){return m.NULLABLE}};return Ce({},r,v(r))}function wr(e){var r={parse:function(t,n){return t==null?{ok:!0,value:void 0}:e.parse(t,n)},json:function(t,n){return n?.omitUndefined&&t===void 0?{ok:!0,value:void 0}:t==null?{ok:!0,value:null}:e.json(t,n)},getType:function(){return m.OPTIONAL}};return Ce({},r,v(r))}function ri(e){var r={parse:function(t,n){return t===void 0?{ok:!0,value:void 0}:t===null?{ok:!0,value:null}:e.parse(t,n)},json:function(t,n){return t===void 0?{ok:!0,value:void 0}:t===null?{ok:!0,value:null}:e.json(t,n)},getType:function(){return m.OPTIONAL_NULLABLE}};return Ce({},r,v(r))}function Sr(e,r){var t={parse:function(n,i){var a=e.parse(n,i);return a.ok?{ok:!0,value:r.transform(a.value)}:a},json:function(n,i){var a=r.untransform(n);return e.json(a,i)},getType:function(){return e.getType()}};return Ce({},t,v(t))}function ti(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ni(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){ti(e,i,t[i])})}return e}function mt(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function dt(){var e={parse:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return(typeof r>"u"?"undefined":mt(r))==="bigint"?{ok:!0,value:r}:typeof r=="number"?{ok:!0,value:BigInt(r)}:{ok:!1,errors:[{path:i,message:g(r,"bigint | number")}]}},json:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return(typeof r>"u"?"undefined":mt(r))!=="bigint"?{ok:!1,errors:[{path:i,message:g(r,"bigint")}]}:{ok:!0,value:r}},getType:function(){return m.BIGINT}};return ni({},O(e),v(e))}function oi(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ii(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function ai(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){oi(e,i,t[i])})}return e}var si=/^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;function yt(){var e={parse:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return typeof r!="string"?{ok:!1,errors:[{path:i,message:g(r,"string")}]}:si.test(r)?{ok:!0,value:new Date(r)}:{ok:!1,errors:[{path:i,message:g(r,"ISO 8601 date string")}]}},json:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return ii(r,Date)?{ok:!0,value:r.toISOString()}:{ok:!1,errors:[{path:i,message:g(r,"Date object")}]}},getType:function(){return m.DATE}};return ai({},O(e),v(e))}function ci(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ui(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){ci(e,i,t[i])})}return e}function I(e,r){return function(){var t={parse:r,json:r,getType:function(){return e}};return ui({},O(t),v(t))}}function Ne(e){var r=new Set(e),t=I(m.ENUM,function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.allowUnrecognizedEnumValues,c=i.breadcrumbsPrefix,s=c===void 0?[]:c;return typeof n!="string"?{ok:!1,errors:[{path:s,message:g(n,"string")}]}:!r.has(n)&&!a?{ok:!1,errors:[{path:s,message:g(n,"enum")}]}:{ok:!0,value:n}});return t()}function fi(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function li(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){fi(e,i,t[i])})}return e}function bt(e){var r=Er(e);return li({},r,v(r))}function Er(e){return{parse:function(r,t){return re(e).parse(r,t)},json:function(r,t){return re(e).json(r,t)},getType:function(){return re(e).getType()}}}function re(e){var r=e;return r.__zurg_memoized==null&&(r.__zurg_memoized=e()),r.__zurg_memoized}function he(e){return Object.entries(e)}function ht(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function pi(e){if(Array.isArray(e))return e}function mi(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,s;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,s=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw s}}return n}}function di(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function yi(e,r){return pi(e)||mi(e,r)||bi(e,r)||di()}function bi(e,r){if(e){if(typeof e=="string")return ht(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ht(e,r)}}function ge(e,r){var t=new Set(r);return Object.entries(e).reduce(function(n,i){var a=yi(i,2),c=a[0],s=a[1];return t.has(c)&&(n[c]=s),n},{})}function hi(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function J(e){if((typeof e>"u"?"undefined":hi(e))!=="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function ve(e){return Object.keys(e)}function gt(e,r){var t=[],n=[],i=!0,a=!1,c=void 0;try{for(var s=e[Symbol.iterator](),l;!(i=(l=s.next()).done);i=!0){var f=l.value;r(f)?t.push(f):n.push(f)}}catch(p){a=!0,c=p}finally{try{!i&&s.return!=null&&s.return()}finally{if(a)throw c}}return[t,n]}function vt(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function gi(e){if(Array.isArray(e))return e}function _t(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function vi(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,s;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,s=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw s}}return n}}function _i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Or(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){_t(e,i,t[i])})}return e}function xi(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function wi(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xi(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Si(e,r){return gi(e)||vi(e,r)||Ei(e,r)||_i()}function Ei(e,r){if(e){if(typeof e=="string")return vt(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return vt(e,r)}}function C(e){return{withParsedProperties:function(r){return Pr(e,r)}}}function Pr(e,r){var t={parse:function(n,i){var a=e.parse(n,i);if(!a.ok)return a;var c=Object.entries(r).reduce(function(s,l){var f=Si(l,2),p=f[0],d=f[1];return wi(Or({},s),_t({},p,typeof d=="function"?d(a.value):d))},{});return{ok:!0,value:Or({},a.value,c)}},json:function(n,i){if(!J(n)){var a;return{ok:!1,errors:[{path:(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],message:g(n,"object")}]}}var c=new Set(Object.keys(r)),s=ge(n,Object.keys(n).filter(function(l){return!c.has(l)}));return e.json(s,i)},getType:function(){return e.getType()}};return Or({},t,v(t),C(t))}function xt(e,r){return{rawKey:e,valueSchema:r,isProperty:!0}}function F(e){return e.isProperty}function Ar(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Oi(e){if(Array.isArray(e))return e}function Pi(e){if(Array.isArray(e))return Ar(e)}function Ai(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ii(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zi(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,s;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,s=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw s}}return n}}function Ti(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ri(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Ai(e,i,t[i])})}return e}function ji(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function _e(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ji(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function xe(e,r){return Oi(e)||zi(e,r)||Ot(e,r)||Ti()}function D(e){return Pi(e)||Ii(e)||Ot(e)||Ri()}function Ot(e,r){if(e){if(typeof e=="string")return Ar(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ar(e,r)}}function Be(e){var r={_getRawProperties:function(){return Object.entries(e).map(function(t){var n=xe(t,2),i=n[0],a=n[1];return F(a)?a.rawKey:i})},_getParsedProperties:function(){return ve(e)},parse:function(t,n){var i={},a=[],c=!0,s=!1,l=void 0;try{for(var f=he(e)[Symbol.iterator](),p;!(c=(p=f.next()).done);c=!0){var d=xe(p.value,2),_=d[0],b=d[1],y=F(b)?b.rawKey:_,h=F(b)?b.valueSchema:b,E={rawKey:y,parsedKey:_,valueSchema:h};i[y]=E,Et(h)&&a.push(y)}}catch(w){s=!0,l=w}finally{try{!c&&f.return!=null&&f.return()}finally{if(s)throw l}}return wt({value:t,requiredKeys:a,getProperty:function(w){var k=i[w];if(k!=null)return{transformedKey:k.parsedKey,transform:function(U){var R;return k.valueSchema.parse(U,_e(N({},n),{breadcrumbsPrefix:D((R=n?.breadcrumbsPrefix)!==null&&R!==void 0?R:[]).concat([w])}))}}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},json:function(t,n){var i=[],a=!0,c=!1,s=void 0;try{for(var l=he(e)[Symbol.iterator](),f;!(a=(f=l.next()).done);a=!0){var p=xe(f.value,2),d=p[0],_=p[1],b=F(_)?_.valueSchema:_;Et(b)&&i.push(d)}}catch(y){c=!0,s=y}finally{try{!a&&l.return!=null&&l.return()}finally{if(c)throw s}}return wt({value:t,requiredKeys:i,getProperty:function(y){var h=e[y];if(h!=null)return F(h)?{transformedKey:h.rawKey,transform:function(E){var w;return h.valueSchema.json(E,_e(N({},n),{breadcrumbsPrefix:D((w=n?.breadcrumbsPrefix)!==null&&w!==void 0?w:[]).concat([y])}))}}:{transformedKey:y,transform:function(E){var w;return h.json(E,_e(N({},n),{breadcrumbsPrefix:D((w=n?.breadcrumbsPrefix)!==null&&w!==void 0?w:[]).concat([y])}))}}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},getType:function(){return m.OBJECT}};return N({},O(r),v(r),C(r),G(r))}function wt(e){var r=e.value,t=e.requiredKeys,n=e.getProperty,i=e.unrecognizedObjectKeys,a=i===void 0?"fail":i,c=e.skipValidation,s=c===void 0?!1:c,l=e.breadcrumbsPrefix,f=l===void 0?[]:l,p;if(!J(r))return{ok:!1,errors:[{path:f,message:g(r,"object")}]};var d=new Set(t),_=[],b={},y=!0,h=!1,E=void 0;try{for(var w=Object.entries(r)[Symbol.iterator](),k;!(y=(k=w.next()).done);y=!0){var U=xe(k.value,2),R=U[0],er=U[1],rr=n(R);if(rr!=null){d.delete(R);var tr=rr.transform(er);if(tr.ok)b[rr.transformedKey]=tr.value;else{var Nr;b[R]=er,(Nr=_).push.apply(Nr,D(tr.errors))}}else switch(a){case"fail":_.push({path:D(f).concat([R]),message:'Unexpected key "'.concat(R,'"')});break;case"strip":break;case"passthrough":b[R]=er;break}}}catch(se){h=!0,E=se}finally{try{!y&&w.return!=null&&w.return()}finally{if(h)throw E}}return(p=_).push.apply(p,D(t.filter(function(se){return d.has(se)}).map(function(se){return{path:f,message:'Missing required key "'.concat(se,'"')}}))),_.length===0||s?{ok:!0,value:b}:{ok:!1,errors:_}}function G(e){return{extend:function(r){var t={_getParsedProperties:function(){return D(e._getParsedProperties()).concat(D(r._getParsedProperties()))},_getRawProperties:function(){return D(e._getRawProperties()).concat(D(r._getRawProperties()))},parse:function(n,i){return St({extensionKeys:r._getRawProperties(),value:n,transformBase:function(a){return e.parse(a,i)},transformExtension:function(a){return r.parse(a,i)}})},json:function(n,i){return St({extensionKeys:r._getParsedProperties(),value:n,transformBase:function(a){return e.json(a,i)},transformExtension:function(a){return r.json(a,i)}})},getType:function(){return m.OBJECT}};return N({},t,v(t),C(t),G(t))},passthrough:function(){var r={_getParsedProperties:function(){return e._getParsedProperties()},_getRawProperties:function(){return e._getRawProperties()},parse:function(t,n){var i=e.parse(t,_e(N({},n),{unrecognizedObjectKeys:"passthrough"}));return i.ok?{ok:!0,value:N({},t,i.value)}:i},json:function(t,n){var i=e.json(t,_e(N({},n),{unrecognizedObjectKeys:"passthrough"}));return i.ok?{ok:!0,value:N({},t,i.value)}:i},getType:function(){return m.OBJECT}};return N({},r,v(r),C(r),G(r))}}}function St(e){var r=e.extensionKeys,t=e.value,n=e.transformBase,i=e.transformExtension,a=new Set(r),c=xe(gt(ve(t),function(d){return a.has(d)}),2),s=c[0],l=c[1],f=n(ge(t,l)),p=i(ge(t,s));return f.ok&&p.ok?{ok:!0,value:N({},f.value,p.value)}:{ok:!1,errors:D(f.ok?[]:f.errors).concat(D(p.ok?[]:p.errors))}}function Et(e){return!ki(e)}function ki(e){switch(e.getType()){case m.ANY:case m.UNKNOWN:case m.OPTIONAL:case m.OPTIONAL_NULLABLE:return!0;default:return!1}}function Pt(e){return Be(e)}function Di(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function At(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Di(e,i,t[i])})}return e}function Ki(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Ui(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ki(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function It(e){var r=Ui(At({},Er(e)),{_getRawProperties:function(){return re(e)._getRawProperties()},_getParsedProperties:function(){return re(e)._getParsedProperties()}});return At({},r,v(r),C(r),G(r))}function zr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Ci(e){if(Array.isArray(e))return zr(e)}function Ni(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Bi(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Mi(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ir(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Ni(e,i,t[i])})}return e}function Wi(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function zt(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wi(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function we(e){return Ci(e)||Bi(e)||Li(e)||Mi()}function Li(e,r){if(e){if(typeof e=="string")return zr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return zr(e,r)}}function Me(e){var r={parse:function(t,n){return Tt(t,function(i,a){var c;return e.parse(i,zt(Ir({},n),{breadcrumbsPrefix:we((c=n?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["[".concat(a,"]")])}))})},json:function(t,n){return Tt(t,function(i,a){var c;return e.json(i,zt(Ir({},n),{breadcrumbsPrefix:we((c=n?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["[".concat(a,"]")])}))})},getType:function(){return m.LIST}};return Ir({},O(r),v(r))}function Tt(e,r){if(!Array.isArray(e))return{ok:!1,errors:[{message:g(e,"list"),path:[]}]};var t=e.map(function(n,i){return r(n,i)});return t.reduce(function(n,i){if(n.ok&&i.ok)return{ok:!0,value:we(n.value).concat([i.value])};var a=[];if(!n.ok){var c;(c=a).push.apply(c,we(n.errors))}if(!i.ok){var s;(s=a).push.apply(s,we(i.errors))}return{ok:!1,errors:a}},{ok:!0,value:[]})}function Rt(e){var r=I(m.STRING_LITERAL,function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.breadcrumbsPrefix,a=i===void 0?[]:i;return t===e?{ok:!0,value:e}:{ok:!1,errors:[{path:a,message:g(t,'"'.concat(e,'"'))}]}});return r()}function jt(e){var r=I(m.BOOLEAN_LITERAL,function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.breadcrumbsPrefix,a=i===void 0?[]:i;return t===e?{ok:!0,value:e}:{ok:!1,errors:[{path:a,message:g(t,"".concat(e.toString()))}]}});return r()}var kt=I(m.ANY,function(e){return{ok:!0,value:e}});var Dt=I(m.BOOLEAN,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.breadcrumbsPrefix,n=t===void 0?[]:t;return typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:g(e,"boolean")}]}});var Kt=I(m.NUMBER,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.breadcrumbsPrefix,n=t===void 0?[]:t;return typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:g(e,"number")}]}});var Ut=I(m.STRING,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.breadcrumbsPrefix,n=t===void 0?[]:t;return typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:g(e,"string")}]}});var Ct=I(m.UNKNOWN,function(e){return{ok:!0,value:e}});function Tr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Ji(e){if(Array.isArray(e))return e}function Fi(e){if(Array.isArray(e))return Tr(e)}function Bt(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Vi(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Hi(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,s;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,s=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw s}}return n}}function Gi(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function $i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function te(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Bt(e,i,t[i])})}return e}function qi(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Se(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qi(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Xi(e,r){return Ji(e)||Hi(e,r)||Mt(e,r)||Gi()}function $(e){return Fi(e)||Vi(e)||Mt(e)||$i()}function Mt(e,r){if(e){if(typeof e=="string")return Tr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Tr(e,r)}}function Wt(e,r){var t={parse:function(n,i){return Nt({value:n,isKeyNumeric:e.getType()===m.NUMBER,transformKey:function(a){var c;return e.parse(a,Se(te({},i),{breadcrumbsPrefix:$((c=i?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["".concat(a," (key)")])}))},transformValue:function(a,c){var s;return r.parse(a,Se(te({},i),{breadcrumbsPrefix:$((s=i?.breadcrumbsPrefix)!==null&&s!==void 0?s:[]).concat(["".concat(c)])}))},breadcrumbsPrefix:i?.breadcrumbsPrefix})},json:function(n,i){return Nt({value:n,isKeyNumeric:e.getType()===m.NUMBER,transformKey:function(a){var c;return e.json(a,Se(te({},i),{breadcrumbsPrefix:$((c=i?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["".concat(a," (key)")])}))},transformValue:function(a,c){var s;return r.json(a,Se(te({},i),{breadcrumbsPrefix:$((s=i?.breadcrumbsPrefix)!==null&&s!==void 0?s:[]).concat(["".concat(c)])}))},breadcrumbsPrefix:i?.breadcrumbsPrefix})},getType:function(){return m.RECORD}};return te({},O(t),v(t))}function Nt(e){var r=e.value,t=e.isKeyNumeric,n=e.transformKey,i=e.transformValue,a=e.breadcrumbsPrefix,c=a===void 0?[]:a;return J(r)?he(r).reduce(function(s,l){var f=Xi(l,2),p=f[0],d=f[1];if(d===void 0)return s;var _=s,b=p;if(t){var y=p.length>0?Number(p):NaN;isNaN(y)||(b=y)}var h=n(b),E=i(d,b);if(_.ok&&h.ok&&E.ok)return{ok:!0,value:Se(te({},_.value),Bt({},h.value,E.value))};var w=[];if(!_.ok){var k;(k=w).push.apply(k,$(_.errors))}if(!h.ok){var U;(U=w).push.apply(U,$(h.errors))}if(!E.ok){var R;(R=w).push.apply(R,$(E.errors))}return{ok:!1,errors:w}},{ok:!0,value:{}}):{ok:!1,errors:[{path:c,message:g(r,"object")}]}}function Rr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Yi(e){if(Array.isArray(e))return Rr(e)}function Qi(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Zi(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function ea(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ra(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ta(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Qi(e,i,t[i])})}return e}function na(e){return Yi(e)||ea(e)||oa(e)||ra()}function oa(e,r){if(e){if(typeof e=="string")return Rr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Rr(e,r)}}function Lt(e){var r=Me(e),t={parse:function(n,i){var a=r.parse(n,i);return a.ok?{ok:!0,value:new Set(a.value)}:a},json:function(n,i){if(!Zi(n,Set)){var a;return{ok:!1,errors:[{path:(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],message:g(n,"Set")}]}}var c=r.json(na(n),i);return c},getType:function(){return m.SET}};return ta({},O(t),v(t))}function Jt(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function ia(e){if(Array.isArray(e))return e}function aa(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function sa(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,s;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,s=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw s}}return n}}function ca(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Vt(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){aa(e,i,t[i])})}return e}function ua(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function fa(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ua(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function la(e,r){return ia(e)||sa(e,r)||pa(e,r)||ca()}function pa(e,r){if(e){if(typeof e=="string")return Jt(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Jt(e,r)}}function Ht(e){var r={parse:function(t,n){return Ft(function(i,a){return i.parse(t,a)},e,n)},json:function(t,n){return Ft(function(i,a){return i.json(t,a)},e,n)},getType:function(){return m.UNDISCRIMINATED_UNION}};return Vt({},O(r),v(r))}function Ft(e,r,t){var n=[],i=!0,a=!1,c=void 0;try{for(var s=r.entries()[Symbol.iterator](),l;!(i=(l=s.next()).done);i=!0){var f=la(l.value,2),p=f[0],d=f[1],_=e(d,fa(Vt({},t),{skipValidation:!1}));if(_.ok)return _;var b=!0,y=!1,h=void 0;try{for(var E=_.errors[Symbol.iterator](),w;!(b=(w=E.next()).done);b=!0){var k=w.value;n.push({path:k.path,message:"[Variant ".concat(p,"] ").concat(k.message)})}}catch(U){y=!0,h=U}finally{try{!b&&E.return!=null&&E.return()}finally{if(y)throw h}}}}catch(U){a=!0,c=U}finally{try{!i&&s.return!=null&&s.return()}finally{if(a)throw c}}return{ok:!1,errors:n}}function Gt(e,r){return{parsedDiscriminant:e,rawDiscriminant:r}}function jr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function ma(e){if(Array.isArray(e))return jr(e)}function kr(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function da(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ya(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Dr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){kr(e,i,t[i])})}return e}function ba(e,r){if(e==null)return{};var t=ha(e,r),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function ha(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&(t[i]=e[i]);return t}function Kr(e){return ma(e)||da(e)||_a(e)||ya()}function ga(e,r){if(Ur(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Ur(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function va(e){var r=ga(e,"string");return Ur(r)==="symbol"?r:String(r)}function Ur(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function _a(e,r){if(e){if(typeof e=="string")return jr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return jr(e,r)}}function qt(e,r){var t=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=Ne(ve(r)),a={parse:function(c,s){return $t({value:c,discriminant:t,transformedDiscriminant:n,transformDiscriminantValue:function(l){var f;return i.parse(l,{allowUnrecognizedEnumValues:s?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:Kr((f=s?.breadcrumbsPrefix)!==null&&f!==void 0?f:[]).concat([t])})},getAdditionalPropertiesSchema:function(l){return r[l]},allowUnrecognizedUnionMembers:s?.allowUnrecognizedUnionMembers,transformAdditionalProperties:function(l,f){return f.parse(l,s)},breadcrumbsPrefix:s?.breadcrumbsPrefix})},json:function(c,s){return $t({value:c,discriminant:n,transformedDiscriminant:t,transformDiscriminantValue:function(l){var f;return i.json(l,{allowUnrecognizedEnumValues:s?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:Kr((f=s?.breadcrumbsPrefix)!==null&&f!==void 0?f:[]).concat([n])})},getAdditionalPropertiesSchema:function(l){return r[l]},allowUnrecognizedUnionMembers:s?.allowUnrecognizedUnionMembers,transformAdditionalProperties:function(l,f){return f.json(l,s)},breadcrumbsPrefix:s?.breadcrumbsPrefix})},getType:function(){return m.UNION}};return Dr({},O(a),v(a),C(a))}function $t(e){var r=e.value,t=e.discriminant,n=e.transformedDiscriminant,i=e.transformDiscriminantValue,a=e.getAdditionalPropertiesSchema,c=e.allowUnrecognizedUnionMembers,s=c===void 0?!1:c,l=e.transformAdditionalProperties,f=e.breadcrumbsPrefix,p=f===void 0?[]:f;if(!J(r))return{ok:!1,errors:[{path:p,message:g(r,"object")}]};var d=r[t],_=ba(r,[t].map(va));if(d==null)return{ok:!1,errors:[{path:p,message:'Missing discriminant ("'.concat(t,'")')}]};var b=i(d);if(!b.ok)return{ok:!1,errors:b.errors};var y=a(b.value);if(y==null)return s?{ok:!0,value:Dr(kr({},n,b.value),_)}:{ok:!1,errors:[{path:Kr(p).concat([t]),message:"Unexpected discriminant value"}]};var h=l(_,y);return h.ok?{ok:!0,value:Dr(kr({},n,d),h.value)}:h}var K=o.object({organizationId:o.string(),agentId:o.string(),settings:o.record(o.string(),o.unknown())});var Xt=o.object({}).extend(K);var Yt=o.object({}).extend(K);var Qt=o.enum_(["CONVERSATION","CONVERSATION_MESSAGE","KNOWLEDGE_BASE","KNOWLEDGE_DOCUMENT","ACTION","USER","EVENT","EVENT_TRIGGER","USER_PROFILE","FEEDBACK","INBOX_ITEM","INBOX_ITEM_FIX"]);var B=o.object({referenceId:o.string()});var z=o.object({type:Qt,appId:o.string()}).extend(B);var x=o.object({organizationId:o.string(),agentId:o.string()}).extend(z);var Zt=o.enum_(["THUMBS_UP","THUMBS_DOWN","INSERT","HANDOFF"]);var en=o.object({type:Zt,text:o.string().optional()});var rn=o.object({feedbackId:x,conversationId:x,conversationMessageId:x,userId:x.optional(),createdAt:o.date().optional()}).extend(en);var tn=o.object({feedbacks:o.list(rn)}).extend(K);var nn=o.object({conversations:o.list(x)}).extend(K);var on=o.enum_(["EMAIL","PHONE_NUMBER"]);var We=o.object({value:o.string(),type:on});var an=o.object({userId:B.optional(),userIdentifiers:o.list(We),allUserData:o.record(o.string(),o.record(o.string(),o.string())),defaultUserData:o.record(o.string(),o.string())});var sn=o.object({actionId:o.string(),conversationId:x.optional(),conversationMetadata:o.record(o.string(),o.string()),parameters:o.record(o.string(),o.unknown()),user:an,transientData:o.record(o.string(),o.string()).optional()}).extend(K);var kp=o.object({response:o.string()});var cn=o.object({knowledgeBaseId:B}).extend(K);var Gp=o.object({message:o.string().optional()});var qp=o.object({referenceId:o.string(),appId:o.string()});var un=o.enum_(["text","array","color","image","multiline","section"]);var Le=o.enum_(["VISIBLE","PARTIALLY_VISIBLE","HIDDEN"]);var fn=o.object({key:o.string(),displayName:o.string(),description:o.string().optional(),type:un,visibility:Le.optional(),fields:o.lazy(function(){return ln}).optional()});var ln=o.list(o.lazyObject(function(){return fn}));var pn=o.object({value:o.string(),visibility:Le});var Je=o.object({identifiers:o.list(We),data:o.record(o.string(),pn)});var fm=o.object({userId:B}).extend(Je);var dm=o.object({userId:x,allUserData:o.record(o.string(),o.record(o.string(),o.string())),defaultUserData:o.record(o.string(),o.string())}).extend(Je);var mn=o.enum_(["CONVERSATION_CREATED","FEEDBACK_CREATED","INBOX_ITEM_CREATED"]);var dn=o.object({description:o.string(),type:mn});var xm=o.object({triggerId:x}).extend(dn);var Sm=o.object({number:o.number(),size:o.number(),totalElements:o.number(),totalPages:o.number()});var Om=o.object({page:o.number().optional(),size:o.number().optional(),sortId:o.string().optional(),sortDesc:o.boolean().optional()});var Fe=o.enum_(["STRING","BOOLEAN","NUMBER"]);var Ve=o.object({label:o.string(),value:o.unknown()});var yn=o.enum_(["POSITIVE","NEGATIVE","NEUTRAL","MIXED","UNKNOWN"]);var bn=o.object({actionIds:o.list(z),incompleteActionIds:o.list(z)});var hn=o.object({userRequest:o.string().optional(),agentResponse:o.string().optional(),resolutionStatus:o.string().optional(),category:o.string().optional(),sentiment:yn.optional()});var gn=o.object({conversationId:z});var He=o.enum_(["SHORT","MEDIUM","LONG"]);var vn=o.enum_(["MARKDOWN","FORMS","IMAGES","CHARTS_HIGHCHARTS_TS"]);var _n=o.object({capabilities:o.list(vn),isCopilot:o.boolean(),responseLength:He});var xn=o.object({responseConfig:_n.optional(),subject:o.string().optional(),url:o.string().optional(),createdAt:o.date().optional(),updatedAt:o.date().optional(),tags:o.set(o.string()).optional(),metadata:o.record(o.string(),o.string()).optional(),allMetadata:o.record(o.string(),o.record(o.string(),o.string()))});var wn=o.object({url:o.string()});var Sn=o.enum_(["USER","HUMAN_AGENT","EXTERNAL_SYSTEM"]);var Ge=o.object({createdAt:o.date().optional(),updatedAt:o.date().optional()});var En=o.object({userId:B,text:o.string(),userMessageType:Sn}).extend(Ge);var On=o.object({conversationMessageId:x,language:o.string().optional(),attachments:o.list(wn)}).extend(En);var Pn=o.enum_(["BOT_RESPONSE","BOT_SUGGESTION"]);var An=o.object({text:o.string()});var In=o.object({id:o.string(),label:o.string(),description:o.string(),required:o.boolean(),suggestion:o.unknown().optional(),type:Fe,enumOptions:o.list(Ve).optional()});var zn=o.object({id:o.string(),formLabel:o.string(),fields:o.list(In),submitLabel:o.string()});var Tn=o.enum_(["HIGHCHARTS_TS"]);var Rn=o.object({label:o.string(),specSchema:Tn,spec:o.string()});var jn=o.union("type",{text:An,actionForm:zn,chart:Rn}).transform({transform:function(e){return e},untransform:function(e){return e}});var kn=o.object({title:o.string(),url:o.string()});var Dn=o.object({followupQuestions:o.list(o.string()),sources:o.list(kn),language:o.string().optional()});var Kn=o.object({conversationMessageId:x,botMessageType:Pn,responses:o.list(jn),metadata:Dn}).extend(Ge);var Un=o.union("type",{user:On,bot:Kn}).transform({transform:function(e){return e},untransform:function(e){return e}});var Rd=o.object({conversationId:x,messages:o.list(Un),analysis:hn,summary:bn,deleted:o.boolean()}).extend(xn);var Cr=o.object({documentId:z,documentName:o.string(),documentExcerpt:o.string(),legacyCorpusMavenId:o.string(),legacyDocumentMavenId:o.string()});var Cn=o.object({knowledgeReviewed:o.list(Cr),knowledgeUtilized:o.list(Cr)});var $e=o.object({actionId:z,actionName:o.string()});var qe=o.object({actionParameters:o.record(o.string(),o.unknown()),executionResult:o.string().optional(),executionError:o.string().optional()}).extend($e);var Nn=o.object({actionsReviewed:o.list($e),actionsExecuted:o.list(qe)});var Bn=o.object({}).extend(qe);var Mn=o.object({safetyCheckPassed:o.boolean()});var Wn=o.union("type",{knowledge:Cn,actions:Nn,form:Bn,safety:Mn}).transform({transform:function(e){return e},untransform:function(e){return e}});var Zd=o.object({items:o.list(Wn)});var Ln=o.object({id:o.string(),label:o.string(),description:o.string(),required:o.boolean(),type:Fe.optional(),enumOptions:o.list(Ve).optional()});var Jn=o.object({name:o.string(),description:o.string(),userInteractionRequired:o.boolean(),buttonName:o.string().optional(),precondition:o.lazy(function(){return Xe}).optional(),userFormParameters:o.list(Ln)});var cy=o.object({actionId:x}).extend(Jn);var Fn=o.enum_(["NOT"]);var V=o.object({operator:Fn.optional()});var Ye=o.object({key:o.string(),value:o.string().optional()}).extend(V);var Vn=o.object({tags:o.set(o.string())}).extend(V);var Hn=o.object({actionId:o.string(),appId:o.string().optional()}).extend(V);var Gn=o.object({useMarkdown:o.boolean().optional(),useForms:o.boolean().optional(),useImages:o.boolean().optional(),isCopilot:o.boolean().optional(),responseLength:He.optional()}).extend(V);var $n=o.union("conversationPreconditionType",{tags:Vn,metadata:Ye,actionExecuted:Hn,responseConfig:Gn}).transform({transform:function(e){return e},untransform:function(e){return e}});var Xe=o.union("preconditionType",{user:Ye,conversation:o.object({value:$n}),group:o.lazyObject(function(){return qn})}).transform({transform:function(e){return e},untransform:function(e){return e}});var Xn=o.enum_(["AND","OR"]);var qn=o.object({operator:Xn,preconditions:o.list(o.lazy(function(){return Xe}))});var ne=o.object({knowledgeBaseId:z});var Qe=o.object({documentId:z,title:o.string().optional(),snippet:o.string().optional()});var Yn=o.enum_(["OPEN","USER_RESOLVED","SYSTEM_RESOLVED","REGRESSED","IGNORED"]);var Ny=o.enum_(["DUPLICATE_DOCUMENT","DUPLICATE_KNOWLEDGE_BASE","MISSING_KNOWLEDGE","LOW_QUALITY_KNOWLEDGE_BASE"]);var oe=o.object({id:x});var q=o.object({knowledgeBase:ne}).extend(oe);var H=o.object({id:x,createdAt:o.date(),updatedAt:o.date(),status:Yn});var Qn=o.object({recommendedFixes:o.list(q),otherFixes:o.list(q),knowledgeBases:o.list(ne)}).extend(H);var Oe=o.object({documentInformation:Qe}).extend(oe);var Zn=o.object({recommendedFixes:o.list(Oe),otherFixes:o.list(Oe),documents:o.list(Qe)}).extend(H);var eo=o.object({fix:q,knowledgeBase:ne}).extend(H);var Ze=o.object({suggestedTextTitle:o.string(),suggestedText:o.string()}).extend(oe);var ro=o.object({fix:Ze,conversations:o.list(gn)}).extend(H);var vb=o.union("type",{duplicateKnowledgeBase:Qn,duplicateDocuments:Zn,knowledgeBaseAlert:eo,missingKnowledge:ro}).transform({transform:function(e){return e},untransform:function(e){return e}});var Eb=o.union("type",{addDocument:Ze,deactivateDocument:Oe,deactivateKnowledgeBase:q}).transform({transform:function(e){return e},untransform:function(e){return e}});import ie from"../..";async function ae(e){let t=\`https://developers\${process.env.ENVIRONMENT===void 0?"":\`.\${process.env.ENVIRONMENT==="sandbox"?\`\${process.env.SANDBOX_USER}.sb\`:process.env.ENVIRONMENT}\`}.mavenagi-apis.com/.well-known/jwks\`,n=yr(new URL(t)),i=e.headers.get("authorization").replace("Bearer ","");await fr(i,n,{issuer:"https://developers.mavenagi.com",audience:process.env.MAVENAGI_APP_ID})}async function bg(e){await ae(e);let{organizationId:r,agentId:t,settings:n,actionId:i,conversationId:a,conversationMetadata:c,parameters:s,user:l,transientData:f}=sn.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{let p=await ie.executeAction?.({organizationId:r,agentId:t,settings:n,actionId:i,conversationId:a,conversationMetadata:c,parameters:s,user:l,transientData:f});return new Response(JSON.stringify({response:p}),{status:200,headers:{"Content-Type":"application/json"}})}catch(p){return console.error(p),p instanceof Error?new Response(p.message,{status:500}):new Response("No result returned",{status:204})}}async function hg(e){await ae(e);let{organizationId:r,agentId:t,settings:n,feedbacks:i}=tn.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await ie.feedbackCreatedOrUpdated?.({organizationId:r,agentId:t,settings:n,feedbacks:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function gg(e){await ae(e);let{organizationId:r,agentId:t,settings:n,conversations:i}=nn.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await ie.conversationCreatedOrUpdated?.({organizationId:r,agentId:t,settings:n,conversations:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function vg(e){await ae(e);let{organizationId:r,agentId:t,settings:n,knowledgeBaseId:i}=cn.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await ie.knowledgeBaseRefreshed?.({organizationId:r,agentId:t,knowledgeBaseId:i,settings:n}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function _g(e){await ae(e);let{organizationId:r,agentId:t,settings:n}=Yt.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await ie.postInstall?.({organizationId:r,agentId:t,settings:n}),new Response(null)}catch(i){return console.error(i),i instanceof Error?new Response(i.message,{status:400}):new Response("Unknown error",{status:500})}}async function xg(e){await ae(e);let{organizationId:r,agentId:t,settings:n}=Xt.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await ie.preInstall?.({organizationId:r,agentId:t,settings:n}),new Response(null)}catch(i){return console.error(i),i instanceof Error?new Response(i.message,{status:400}):new Response("Unknown error",{status:500})}}export{gg as conversationCreatedOrUpdated,bg as executeAction,hg as feedbackCreatedOrUpdated,vg as knowledgeBaseRefreshed,_g as postInstall,xg as preInstall};\n`},803:t=>{function webpackEmptyContext(t){var s=new Error("Cannot find module '"+t+"'");s.code="MODULE_NOT_FOUND";throw s}webpackEmptyContext.keys=()=>[];webpackEmptyContext.resolve=webpackEmptyContext;webpackEmptyContext.id=803;t.exports=webpackEmptyContext},8501:t=>{function webpackEmptyContext(t){var s=new Error("Cannot find module '"+t+"'");s.code="MODULE_NOT_FOUND";throw s}webpackEmptyContext.keys=()=>[];webpackEmptyContext.resolve=webpackEmptyContext;webpackEmptyContext.id=8501;t.exports=webpackEmptyContext},2613:t=>{"use strict";t.exports=require("assert")},181:t=>{"use strict";t.exports=require("buffer")},5317:t=>{"use strict";t.exports=require("child_process")},4434:t=>{"use strict";t.exports=require("events")},9896:t=>{"use strict";t.exports=require("fs")},1943:t=>{"use strict";t.exports=require("fs/promises")},857:t=>{"use strict";t.exports=require("os")},6928:t=>{"use strict";t.exports=require("path")},2203:t=>{"use strict";t.exports=require("stream")},9023:t=>{"use strict";t.exports=require("util")},702:(t,s,b)=>{"use strict";const F={right:alignRight,center:alignCenter};const B=0;const T=1;const M=2;const R=3;class UI{constructor(t){var s;this.width=t.width;this.wrap=(s=t.wrap)!==null&&s!==void 0?s:true;this.rows=[]}span(...t){const s=this.div(...t);s.span=true}resetOutput(){this.rows=[]}div(...t){if(t.length===0){this.div("")}if(this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]==="string"){return this.applyLayoutDSL(t[0])}const s=t.map((t=>{if(typeof t==="string"){return this.colFromString(t)}return t}));this.rows.push(s);return s}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]==="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){const s=t.split("\n").map((t=>t.split("\t")));let b=0;s.forEach((t=>{if(t.length>1&&U.stringWidth(t[0])>b){b=Math.min(Math.floor(this.width*.5),U.stringWidth(t[0]))}}));s.forEach((t=>{this.div(...t.map(((s,F)=>({text:s.trim(),padding:this.measurePadding(s),width:F===0&&t.length>1?b:undefined}))))}));return this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){const s=U.stripAnsi(t);return[0,s.match(/\s*$/)[0].length,0,s.match(/^\s*/)[0].length]}toString(){const t=[];this.rows.forEach((s=>{this.rowToString(s,t)}));return t.filter((t=>!t.hidden)).map((t=>t.text)).join("\n")}rowToString(t,s){this.rasterize(t).forEach(((b,B)=>{let M="";b.forEach(((b,L)=>{const{width:W}=t[L];const K=this.negatePadding(t[L]);let z=b;if(K>U.stringWidth(b)){z+=" ".repeat(K-U.stringWidth(b))}if(t[L].align&&t[L].align!=="left"&&this.wrap){const s=F[t[L].align];z=s(z,K);if(U.stringWidth(z)<K){z+=" ".repeat((W||0)-U.stringWidth(z)-1)}}const G=t[L].padding||[0,0,0,0];if(G[R]){M+=" ".repeat(G[R])}M+=addBorder(t[L],z,"| ");M+=z;M+=addBorder(t[L],z," |");if(G[T]){M+=" ".repeat(G[T])}if(B===0&&s.length>0){M=this.renderInline(M,s[s.length-1])}}));s.push({text:M.replace(/ +$/,""),span:t.span})}));return s}renderInline(t,s){const b=t.match(/^ */);const F=b?b[0].length:0;const B=s.text;const T=U.stringWidth(B.trimRight());if(!s.span){return t}if(!this.wrap){s.hidden=true;return B+t}if(F<T){return t}s.hidden=true;return B.trimRight()+" ".repeat(F-T)+t.trimLeft()}rasterize(t){const s=[];const b=this.columnWidths(t);let F;t.forEach(((t,T)=>{t.width=b[T];if(this.wrap){F=U.wrap(t.text,this.negatePadding(t),{hard:true}).split("\n")}else{F=t.text.split("\n")}if(t.border){F.unshift("."+"-".repeat(this.negatePadding(t)+2)+".");F.push("'"+"-".repeat(this.negatePadding(t)+2)+"'")}if(t.padding){F.unshift(...new Array(t.padding[B]||0).fill(""));F.push(...new Array(t.padding[M]||0).fill(""))}F.forEach(((t,b)=>{if(!s[b]){s.push([])}const F=s[b];for(let t=0;t<T;t++){if(F[t]===undefined){F.push("")}}F.push(t)}))}));return s}negatePadding(t){let s=t.width||0;if(t.padding){s-=(t.padding[R]||0)+(t.padding[T]||0)}if(t.border){s-=4}return s}columnWidths(t){if(!this.wrap){return t.map((t=>t.width||U.stringWidth(t.text)))}let s=t.length;let b=this.width;const F=t.map((t=>{if(t.width){s--;b-=t.width;return t.width}return undefined}));const B=s?Math.floor(b/s):0;return F.map(((s,b)=>{if(s===undefined){return Math.max(B,_minWidth(t[b]))}return s}))}}function addBorder(t,s,b){if(t.border){if(/[.']-+[.']/.test(s)){return""}if(s.trim().length!==0){return b}return" "}return""}function _minWidth(t){const s=t.padding||[];const b=1+(s[R]||0)+(s[T]||0);if(t.border){return b+4}return b}function getWindowWidth(){if(typeof process==="object"&&process.stdout&&process.stdout.columns){return process.stdout.columns}return 80}function alignRight(t,s){t=t.trim();const b=U.stringWidth(t);if(b<s){return" ".repeat(s-b)+t}return t}function alignCenter(t,s){t=t.trim();const b=U.stringWidth(t);if(b>=s){return t}return" ".repeat(s-b>>1)+t}let U;function cliui(t,s){U=s;return new UI({width:(t===null||t===void 0?void 0:t.width)||getWindowWidth(),wrap:t===null||t===void 0?void 0:t.wrap})}const L=b(1838);const W=b(764);const K=b(2986);function ui(t){return cliui(t,{stringWidth:L,stripAnsi:W,wrap:K})}t.exports=ui},9162:(t,s,b)=>{"use strict";var F=b(9896);var B=b(9023);var T=b(6928);let M;class Y18N{constructor(t){t=t||{};this.directory=t.directory||"./locales";this.updateFiles=typeof t.updateFiles==="boolean"?t.updateFiles:true;this.locale=t.locale||"en";this.fallbackToLanguage=typeof t.fallbackToLanguage==="boolean"?t.fallbackToLanguage:true;this.cache=Object.create(null);this.writeQueue=[]}__(...t){if(typeof arguments[0]!=="string"){return this._taggedLiteral(arguments[0],...arguments)}const s=t.shift();let cb=function(){};if(typeof t[t.length-1]==="function")cb=t.pop();cb=cb||function(){};if(!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][s]&&this.updateFiles){this.cache[this.locale][s]=s;this._enqueueWrite({directory:this.directory,locale:this.locale,cb:cb})}else{cb()}return M.format.apply(M.format,[this.cache[this.locale][s]||s].concat(t))}__n(){const t=Array.prototype.slice.call(arguments);const s=t.shift();const b=t.shift();const F=t.shift();let cb=function(){};if(typeof t[t.length-1]==="function")cb=t.pop();if(!this.cache[this.locale])this._readLocaleFile();let B=F===1?s:b;if(this.cache[this.locale][s]){const t=this.cache[this.locale][s];B=t[F===1?"one":"other"]}if(!this.cache[this.locale][s]&&this.updateFiles){this.cache[this.locale][s]={one:s,other:b};this._enqueueWrite({directory:this.directory,locale:this.locale,cb:cb})}else{cb()}const T=[B];if(~B.indexOf("%d"))T.push(F);return M.format.apply(M.format,T.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){if(!this.cache[this.locale])this._readLocaleFile();for(const s in t){if(Object.prototype.hasOwnProperty.call(t,s)){this.cache[this.locale][s]=t[s]}}}_taggedLiteral(t,...s){let b="";t.forEach((function(t,F){const B=s[F+1];b+=t;if(typeof B!=="undefined"){b+="%s"}}));return this.__.apply(this,[b].concat([].slice.call(s,1)))}_enqueueWrite(t){this.writeQueue.push(t);if(this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){const t=this;const s=this.writeQueue[0];const b=s.directory;const F=s.locale;const B=s.cb;const T=this._resolveLocaleFile(b,F);const R=JSON.stringify(this.cache[F],null,2);M.fs.writeFile(T,R,"utf-8",(function(s){t.writeQueue.shift();if(t.writeQueue.length>0)t._processWriteQueue();B(s)}))}_readLocaleFile(){let t={};const s=this._resolveLocaleFile(this.directory,this.locale);try{if(M.fs.readFileSync){t=JSON.parse(M.fs.readFileSync(s,"utf-8"))}}catch(b){if(b instanceof SyntaxError){b.message="syntax error in "+s}if(b.code==="ENOENT")t={};else throw b}this.cache[this.locale]=t}_resolveLocaleFile(t,s){let b=M.resolve(t,"./",s+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(b)&&~s.lastIndexOf("_")){const F=M.resolve(t,"./",s.split("_")[0]+".json");if(this._fileExistsSync(F))b=F}return b}_fileExistsSync(t){return M.exists(t)}}function y18n$1(t,s){M=s;const b=new Y18N(t);return{__:b.__.bind(b),__n:b.__n.bind(b),setLocale:b.setLocale.bind(b),getLocale:b.getLocale.bind(b),updateLocale:b.updateLocale.bind(b),locale:b.locale}}var R={fs:{readFileSync:F.readFileSync,writeFile:F.writeFile},format:B.format,resolve:T.resolve,exists:t=>{try{return F.statSync(t).isFile()}catch(t){return false}}};const y18n=t=>y18n$1(t,R);t.exports=y18n},6420:(t,s,b)=>{"use strict";var F=b(9023);var B=b(6928);var T=b(9896);function camelCase(t){const s=t!==t.toLowerCase()&&t!==t.toUpperCase();if(!s){t=t.toLowerCase()}if(t.indexOf("-")===-1&&t.indexOf("_")===-1){return t}else{let s="";let b=false;const F=t.match(/^-+/);for(let B=F?F[0].length:0;B<t.length;B++){let F=t.charAt(B);if(b){b=false;F=F.toUpperCase()}if(B!==0&&(F==="-"||F==="_")){b=true}else if(F!=="-"&&F!=="_"){s+=F}}return s}}function decamelize(t,s){const b=t.toLowerCase();s=s||"-";let F="";for(let B=0;B<t.length;B++){const T=b.charAt(B);const M=t.charAt(B);if(T!==M&&B>0){F+=`${s}${b.charAt(B)}`}else{F+=M}}return F}function looksLikeNumber(t){if(t===null||t===undefined)return false;if(typeof t==="number")return true;if(/^0x[0-9a-f]+$/i.test(t))return true;if(/^0[^.]/.test(t))return false;return/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function tokenizeArgString(t){if(Array.isArray(t)){return t.map((t=>typeof t!=="string"?t+"":t))}t=t.trim();let s=0;let b=null;let F=null;let B=null;const T=[];for(let M=0;M<t.length;M++){b=F;F=t.charAt(M);if(F===" "&&!B){if(!(b===" ")){s++}continue}if(F===B){B=null}else if((F==="'"||F==='"')&&!B){B=F}if(!T[s])T[s]="";T[s]+=F}return T}var M;(function(t){t["BOOLEAN"]="boolean";t["STRING"]="string";t["NUMBER"]="number";t["ARRAY"]="array"})(M||(M={}));let R;class YargsParser{constructor(t){R=t}parse(t,s){const b=Object.assign({alias:undefined,array:undefined,boolean:undefined,config:undefined,configObjects:undefined,configuration:undefined,coerce:undefined,count:undefined,default:undefined,envPrefix:undefined,narg:undefined,normalize:undefined,string:undefined,number:undefined,__:undefined,key:undefined},s);const F=tokenizeArgString(t);const B=typeof t==="string";const T=combineAliases(Object.assign(Object.create(null),b.alias));const U=Object.assign({"boolean-negation":true,"camel-case-expansion":true,"combine-arrays":false,"dot-notation":true,"duplicate-arguments-array":true,"flatten-duplicate-arrays":true,"greedy-arrays":true,"halt-at-non-option":false,"nargs-eats-options":false,"negation-prefix":"no-","parse-numbers":true,"parse-positional-numbers":true,"populate--":false,"set-placeholder-key":false,"short-option-groups":true,"strip-aliased":false,"strip-dashed":false,"unknown-options-as-args":false},b.configuration);const L=Object.assign(Object.create(null),b.default);const W=b.configObjects||[];const K=b.envPrefix;const z=U["populate--"];const G=z?"--":"_";const H=Object.create(null);const V=Object.create(null);const q=b.__||R.format;const J={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]};const Y=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/;const X=new RegExp("^--"+U["negation-prefix"]+"(.+)");[].concat(b.array||[]).filter(Boolean).forEach((function(t){const s=typeof t==="object"?t.key:t;const b=Object.keys(t).map((function(t){const s={boolean:"bools",string:"strings",number:"numbers"};return s[t]})).filter(Boolean).pop();if(b){J[b][s]=true}J.arrays[s]=true;J.keys.push(s)}));[].concat(b.boolean||[]).filter(Boolean).forEach((function(t){J.bools[t]=true;J.keys.push(t)}));[].concat(b.string||[]).filter(Boolean).forEach((function(t){J.strings[t]=true;J.keys.push(t)}));[].concat(b.number||[]).filter(Boolean).forEach((function(t){J.numbers[t]=true;J.keys.push(t)}));[].concat(b.count||[]).filter(Boolean).forEach((function(t){J.counts[t]=true;J.keys.push(t)}));[].concat(b.normalize||[]).filter(Boolean).forEach((function(t){J.normalize[t]=true;J.keys.push(t)}));if(typeof b.narg==="object"){Object.entries(b.narg).forEach((([t,s])=>{if(typeof s==="number"){J.nargs[t]=s;J.keys.push(t)}}))}if(typeof b.coerce==="object"){Object.entries(b.coerce).forEach((([t,s])=>{if(typeof s==="function"){J.coercions[t]=s;J.keys.push(t)}}))}if(typeof b.config!=="undefined"){if(Array.isArray(b.config)||typeof b.config==="string"){[].concat(b.config).filter(Boolean).forEach((function(t){J.configs[t]=true}))}else if(typeof b.config==="object"){Object.entries(b.config).forEach((([t,s])=>{if(typeof s==="boolean"||typeof s==="function"){J.configs[t]=s}}))}}extendAliases(b.key,T,b.default,J.arrays);Object.keys(L).forEach((function(t){(J.aliases[t]||[]).forEach((function(s){L[s]=L[t]}))}));let Z=null;checkConfiguration();let Q=[];const ee=Object.assign(Object.create(null),{_:[]});const re={};for(let t=0;t<F.length;t++){const s=F[t];const b=s.replace(/^-{3,}/,"---");let B;let T;let M;let R;let L;let W;if(s!=="--"&&/^-/.test(s)&&isUnknownOptionAsArg(s)){pushPositional(s)}else if(b.match(/^---+(=|$)/)){pushPositional(s);continue}else if(s.match(/^--.+=/)||!U["short-option-groups"]&&s.match(/^-.+=/)){R=s.match(/^--?([^=]+)=([\s\S]*)$/);if(R!==null&&Array.isArray(R)&&R.length>=3){if(checkAllAliases(R[1],J.arrays)){t=eatArray(t,R[1],F,R[2])}else if(checkAllAliases(R[1],J.nargs)!==false){t=eatNargs(t,R[1],F,R[2])}else{setArg(R[1],R[2],true)}}}else if(s.match(X)&&U["boolean-negation"]){R=s.match(X);if(R!==null&&Array.isArray(R)&&R.length>=2){T=R[1];setArg(T,checkAllAliases(T,J.arrays)?[false]:false)}}else if(s.match(/^--.+/)||!U["short-option-groups"]&&s.match(/^-[^-]+/)){R=s.match(/^--?(.+)/);if(R!==null&&Array.isArray(R)&&R.length>=2){T=R[1];if(checkAllAliases(T,J.arrays)){t=eatArray(t,T,F)}else if(checkAllAliases(T,J.nargs)!==false){t=eatNargs(t,T,F)}else{L=F[t+1];if(L!==undefined&&(!L.match(/^-/)||L.match(Y))&&!checkAllAliases(T,J.bools)&&!checkAllAliases(T,J.counts)){setArg(T,L);t++}else if(/^(true|false)$/.test(L)){setArg(T,L);t++}else{setArg(T,defaultValue(T))}}}}else if(s.match(/^-.\..+=/)){R=s.match(/^-([^=]+)=([\s\S]*)$/);if(R!==null&&Array.isArray(R)&&R.length>=3){setArg(R[1],R[2])}}else if(s.match(/^-.\..+/)&&!s.match(Y)){L=F[t+1];R=s.match(/^-(.\..+)/);if(R!==null&&Array.isArray(R)&&R.length>=2){T=R[1];if(L!==undefined&&!L.match(/^-/)&&!checkAllAliases(T,J.bools)&&!checkAllAliases(T,J.counts)){setArg(T,L);t++}else{setArg(T,defaultValue(T))}}}else if(s.match(/^-[^-]+/)&&!s.match(Y)){M=s.slice(1,-1).split("");B=false;for(let b=0;b<M.length;b++){L=s.slice(b+2);if(M[b+1]&&M[b+1]==="="){W=s.slice(b+3);T=M[b];if(checkAllAliases(T,J.arrays)){t=eatArray(t,T,F,W)}else if(checkAllAliases(T,J.nargs)!==false){t=eatNargs(t,T,F,W)}else{setArg(T,W)}B=true;break}if(L==="-"){setArg(M[b],L);continue}if(/[A-Za-z]/.test(M[b])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(L)&&checkAllAliases(L,J.bools)===false){setArg(M[b],L);B=true;break}if(M[b+1]&&M[b+1].match(/\W/)){setArg(M[b],L);B=true;break}else{setArg(M[b],defaultValue(M[b]))}}T=s.slice(-1)[0];if(!B&&T!=="-"){if(checkAllAliases(T,J.arrays)){t=eatArray(t,T,F)}else if(checkAllAliases(T,J.nargs)!==false){t=eatNargs(t,T,F)}else{L=F[t+1];if(L!==undefined&&(!/^(-|--)[^-]/.test(L)||L.match(Y))&&!checkAllAliases(T,J.bools)&&!checkAllAliases(T,J.counts)){setArg(T,L);t++}else if(/^(true|false)$/.test(L)){setArg(T,L);t++}else{setArg(T,defaultValue(T))}}}}else if(s.match(/^-[0-9]$/)&&s.match(Y)&&checkAllAliases(s.slice(1),J.bools)){T=s.slice(1);setArg(T,defaultValue(T))}else if(s==="--"){Q=F.slice(t+1);break}else if(U["halt-at-non-option"]){Q=F.slice(t);break}else{pushPositional(s)}}applyEnvVars(ee,true);applyEnvVars(ee,false);setConfig(ee);setConfigObjects();applyDefaultsAndAliases(ee,J.aliases,L,true);applyCoercions(ee);if(U["set-placeholder-key"])setPlaceholderKeys(ee);Object.keys(J.counts).forEach((function(t){if(!hasKey(ee,t.split(".")))setArg(t,0)}));if(z&&Q.length)ee[G]=[];Q.forEach((function(t){ee[G].push(t)}));if(U["camel-case-expansion"]&&U["strip-dashed"]){Object.keys(ee).filter((t=>t!=="--"&&t.includes("-"))).forEach((t=>{delete ee[t]}))}if(U["strip-aliased"]){[].concat(...Object.keys(T).map((t=>T[t]))).forEach((t=>{if(U["camel-case-expansion"]&&t.includes("-")){delete ee[t.split(".").map((t=>camelCase(t))).join(".")]}delete ee[t]}))}function pushPositional(t){const s=maybeCoerceNumber("_",t);if(typeof s==="string"||typeof s==="number"){ee._.push(s)}}function eatNargs(t,s,b,F){let B;let T=checkAllAliases(s,J.nargs);T=typeof T!=="number"||isNaN(T)?1:T;if(T===0){if(!isUndefined(F)){Z=Error(q("Argument unexpected for: %s",s))}setArg(s,defaultValue(s));return t}let M=isUndefined(F)?0:1;if(U["nargs-eats-options"]){if(b.length-(t+1)+M<T){Z=Error(q("Not enough arguments following: %s",s))}M=T}else{for(B=t+1;B<b.length;B++){if(!b[B].match(/^-[^0-9]/)||b[B].match(Y)||isUnknownOptionAsArg(b[B]))M++;else break}if(M<T)Z=Error(q("Not enough arguments following: %s",s))}let R=Math.min(M,T);if(!isUndefined(F)&&R>0){setArg(s,F);R--}for(B=t+1;B<R+t+1;B++){setArg(s,b[B])}return t+R}function eatArray(t,s,b,F){let T=[];let M=F||b[t+1];const R=checkAllAliases(s,J.nargs);if(checkAllAliases(s,J.bools)&&!/^(true|false)$/.test(M)){T.push(true)}else if(isUndefined(M)||isUndefined(F)&&/^-/.test(M)&&!Y.test(M)&&!isUnknownOptionAsArg(M)){if(L[s]!==undefined){const t=L[s];T=Array.isArray(t)?t:[t]}}else{if(!isUndefined(F)){T.push(processValue(s,F,true))}for(let F=t+1;F<b.length;F++){if(!U["greedy-arrays"]&&T.length>0||R&&typeof R==="number"&&T.length>=R)break;M=b[F];if(/^-/.test(M)&&!Y.test(M)&&!isUnknownOptionAsArg(M))break;t=F;T.push(processValue(s,M,B))}}if(typeof R==="number"&&(R&&T.length<R||isNaN(R)&&T.length===0)){Z=Error(q("Not enough arguments following: %s",s))}setArg(s,T);return t}function setArg(t,s,b=B){if(/-/.test(t)&&U["camel-case-expansion"]){const s=t.split(".").map((function(t){return camelCase(t)})).join(".");addNewAlias(t,s)}const F=processValue(t,s,b);const T=t.split(".");setKey(ee,T,F);if(J.aliases[t]){J.aliases[t].forEach((function(t){const s=t.split(".");setKey(ee,s,F)}))}if(T.length>1&&U["dot-notation"]){(J.aliases[T[0]]||[]).forEach((function(s){let b=s.split(".");const B=[].concat(T);B.shift();b=b.concat(B);if(!(J.aliases[t]||[]).includes(b.join("."))){setKey(ee,b,F)}}))}if(checkAllAliases(t,J.normalize)&&!checkAllAliases(t,J.arrays)){const b=[t].concat(J.aliases[t]||[]);b.forEach((function(t){Object.defineProperty(re,t,{enumerable:true,get(){return s},set(t){s=typeof t==="string"?R.normalize(t):t}})}))}}function addNewAlias(t,s){if(!(J.aliases[t]&&J.aliases[t].length)){J.aliases[t]=[s];H[s]=true}if(!(J.aliases[s]&&J.aliases[s].length)){addNewAlias(s,t)}}function processValue(t,s,b){if(b){s=stripQuotes(s)}if(checkAllAliases(t,J.bools)||checkAllAliases(t,J.counts)){if(typeof s==="string")s=s==="true"}let F=Array.isArray(s)?s.map((function(s){return maybeCoerceNumber(t,s)})):maybeCoerceNumber(t,s);if(checkAllAliases(t,J.counts)&&(isUndefined(F)||typeof F==="boolean")){F=increment()}if(checkAllAliases(t,J.normalize)&&checkAllAliases(t,J.arrays)){if(Array.isArray(s))F=s.map((t=>R.normalize(t)));else F=R.normalize(s)}return F}function maybeCoerceNumber(t,s){if(!U["parse-positional-numbers"]&&t==="_")return s;if(!checkAllAliases(t,J.strings)&&!checkAllAliases(t,J.bools)&&!Array.isArray(s)){const b=looksLikeNumber(s)&&U["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${s}`)));if(b||!isUndefined(s)&&checkAllAliases(t,J.numbers)){s=Number(s)}}return s}function setConfig(t){const s=Object.create(null);applyDefaultsAndAliases(s,J.aliases,L);Object.keys(J.configs).forEach((function(b){const F=t[b]||s[b];if(F){try{let t=null;const s=R.resolve(R.cwd(),F);const B=J.configs[b];if(typeof B==="function"){try{t=B(s)}catch(s){t=s}if(t instanceof Error){Z=t;return}}else{t=R.require(s)}setConfigObject(t)}catch(s){if(s.name==="PermissionDenied")Z=s;else if(t[b])Z=Error(q("Invalid JSON config file: %s",F))}}}))}function setConfigObject(t,s){Object.keys(t).forEach((function(b){const F=t[b];const B=s?s+"."+b:b;if(typeof F==="object"&&F!==null&&!Array.isArray(F)&&U["dot-notation"]){setConfigObject(F,B)}else{if(!hasKey(ee,B.split("."))||checkAllAliases(B,J.arrays)&&U["combine-arrays"]){setArg(B,F)}}}))}function setConfigObjects(){if(typeof W!=="undefined"){W.forEach((function(t){setConfigObject(t)}))}}function applyEnvVars(t,s){if(typeof K==="undefined")return;const b=typeof K==="string"?K:"";const F=R.env();Object.keys(F).forEach((function(B){if(b===""||B.lastIndexOf(b,0)===0){const T=B.split("__").map((function(t,s){if(s===0){t=t.substring(b.length)}return camelCase(t)}));if((s&&J.configs[T.join(".")]||!s)&&!hasKey(t,T)){setArg(T.join("."),F[B])}}}))}function applyCoercions(t){let s;const b=new Set;Object.keys(t).forEach((function(F){if(!b.has(F)){s=checkAllAliases(F,J.coercions);if(typeof s==="function"){try{const B=maybeCoerceNumber(F,s(t[F]));[].concat(J.aliases[F]||[],F).forEach((s=>{b.add(s);t[s]=B}))}catch(t){Z=t}}}}))}function setPlaceholderKeys(t){J.keys.forEach((s=>{if(~s.indexOf("."))return;if(typeof t[s]==="undefined")t[s]=undefined}));return t}function applyDefaultsAndAliases(t,s,b,F=false){Object.keys(b).forEach((function(B){if(!hasKey(t,B.split("."))){setKey(t,B.split("."),b[B]);if(F)V[B]=true;(s[B]||[]).forEach((function(s){if(hasKey(t,s.split(".")))return;setKey(t,s.split("."),b[B])}))}}))}function hasKey(t,s){let b=t;if(!U["dot-notation"])s=[s.join(".")];s.slice(0,-1).forEach((function(t){b=b[t]||{}}));const F=s[s.length-1];if(typeof b!=="object")return false;else return F in b}function setKey(t,s,b){let F=t;if(!U["dot-notation"])s=[s.join(".")];s.slice(0,-1).forEach((function(t){t=sanitizeKey(t);if(typeof F==="object"&&F[t]===undefined){F[t]={}}if(typeof F[t]!=="object"||Array.isArray(F[t])){if(Array.isArray(F[t])){F[t].push({})}else{F[t]=[F[t],{}]}F=F[t][F[t].length-1]}else{F=F[t]}}));const B=sanitizeKey(s[s.length-1]);const T=checkAllAliases(s.join("."),J.arrays);const M=Array.isArray(b);let R=U["duplicate-arguments-array"];if(!R&&checkAllAliases(B,J.nargs)){R=true;if(!isUndefined(F[B])&&J.nargs[B]===1||Array.isArray(F[B])&&F[B].length===J.nargs[B]){F[B]=undefined}}if(b===increment()){F[B]=increment(F[B])}else if(Array.isArray(F[B])){if(R&&T&&M){F[B]=U["flatten-duplicate-arrays"]?F[B].concat(b):(Array.isArray(F[B][0])?F[B]:[F[B]]).concat([b])}else if(!R&&Boolean(T)===Boolean(M)){F[B]=b}else{F[B]=F[B].concat([b])}}else if(F[B]===undefined&&T){F[B]=M?b:[b]}else if(R&&!(F[B]===undefined||checkAllAliases(B,J.counts)||checkAllAliases(B,J.bools))){F[B]=[F[B],b]}else{F[B]=b}}function extendAliases(...t){t.forEach((function(t){Object.keys(t||{}).forEach((function(t){if(J.aliases[t])return;J.aliases[t]=[].concat(T[t]||[]);J.aliases[t].concat(t).forEach((function(s){if(/-/.test(s)&&U["camel-case-expansion"]){const b=camelCase(s);if(b!==t&&J.aliases[t].indexOf(b)===-1){J.aliases[t].push(b);H[b]=true}}}));J.aliases[t].concat(t).forEach((function(s){if(s.length>1&&/[A-Z]/.test(s)&&U["camel-case-expansion"]){const b=decamelize(s,"-");if(b!==t&&J.aliases[t].indexOf(b)===-1){J.aliases[t].push(b);H[b]=true}}}));J.aliases[t].forEach((function(s){J.aliases[s]=[t].concat(J.aliases[t].filter((function(t){return s!==t})))}))}))}))}function checkAllAliases(t,s){const b=[].concat(J.aliases[t]||[],t);const F=Object.keys(s);const B=b.find((t=>F.includes(t)));return B?s[B]:false}function hasAnyFlag(t){const s=Object.keys(J);const b=[].concat(s.map((t=>J[t])));return b.some((function(s){return Array.isArray(s)?s.includes(t):s[t]}))}function hasFlagsMatching(t,...s){const b=[].concat(...s);return b.some((function(s){const b=t.match(s);return b&&hasAnyFlag(b[1])}))}function hasAllShortFlags(t){if(t.match(Y)||!t.match(/^-[^-]+/)){return false}let s=true;let b;const F=t.slice(1).split("");for(let B=0;B<F.length;B++){b=t.slice(B+2);if(!hasAnyFlag(F[B])){s=false;break}if(F[B+1]&&F[B+1]==="="||b==="-"||/[A-Za-z]/.test(F[B])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(b)||F[B+1]&&F[B+1].match(/\W/)){break}}return s}function isUnknownOptionAsArg(t){return U["unknown-options-as-args"]&&isUnknownOption(t)}function isUnknownOption(t){t=t.replace(/^-{3,}/,"--");if(t.match(Y)){return false}if(hasAllShortFlags(t)){return false}const s=/^-+([^=]+?)=[\s\S]*$/;const b=/^-+([^=]+?)$/;const F=/^-+([^=]+?)-$/;const B=/^-+([^=]+?\d+)$/;const T=/^-+([^=]+?)\W+.*$/;return!hasFlagsMatching(t,s,X,b,F,B,T)}function defaultValue(t){if(!checkAllAliases(t,J.bools)&&!checkAllAliases(t,J.counts)&&`${t}`in L){return L[t]}else{return defaultForType(guessType(t))}}function defaultForType(t){const s={[M.BOOLEAN]:true,[M.STRING]:"",[M.NUMBER]:undefined,[M.ARRAY]:[]};return s[t]}function guessType(t){let s=M.BOOLEAN;if(checkAllAliases(t,J.strings))s=M.STRING;else if(checkAllAliases(t,J.numbers))s=M.NUMBER;else if(checkAllAliases(t,J.bools))s=M.BOOLEAN;else if(checkAllAliases(t,J.arrays))s=M.ARRAY;return s}function isUndefined(t){return t===undefined}function checkConfiguration(){Object.keys(J.counts).find((t=>{if(checkAllAliases(t,J.arrays)){Z=Error(q("Invalid configuration: %s, opts.count excludes opts.array.",t));return true}else if(checkAllAliases(t,J.nargs)){Z=Error(q("Invalid configuration: %s, opts.count excludes opts.narg.",t));return true}return false}))}return{aliases:Object.assign({},J.aliases),argv:Object.assign(re,ee),configuration:U,defaulted:Object.assign({},V),error:Z,newAliases:Object.assign({},H)}}}function combineAliases(t){const s=[];const b=Object.create(null);let F=true;Object.keys(t).forEach((function(b){s.push([].concat(t[b],b))}));while(F){F=false;for(let t=0;t<s.length;t++){for(let b=t+1;b<s.length;b++){const B=s[t].filter((function(t){return s[b].indexOf(t)!==-1}));if(B.length){s[t]=s[t].concat(s[b]);s.splice(b,1);F=true;break}}}}s.forEach((function(t){t=t.filter((function(t,s,b){return b.indexOf(t)===s}));const s=t.pop();if(s!==undefined&&typeof s==="string"){b[s]=t}}));return b}function increment(t){return t!==undefined?t+1:1}function sanitizeKey(t){if(t==="__proto__")return"___proto___";return t}function stripQuotes(t){return typeof t==="string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}var U,L,W;const K=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12;const z=(L=(U=process===null||process===void 0?void 0:process.versions)===null||U===void 0?void 0:U.node)!==null&&L!==void 0?L:(W=process===null||process===void 0?void 0:process.version)===null||W===void 0?void 0:W.slice(1);if(z){const t=Number(z.match(/^([^.]+)/)[1]);if(t<K){throw Error(`yargs parser supports a minimum Node.js version of ${K}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}}const G=process?process.env:{};const H=new YargsParser({cwd:process.cwd,env:()=>G,format:F.format,normalize:B.normalize,resolve:B.resolve,require:t=>{if(true){return b(803)(t)}else{}}});const V=function Parser(t,s){const b=H.parse(t.slice(),s);return b.argv};V.detailed=function(t,s){return H.parse(t.slice(),s)};V.camelCase=camelCase;V.decamelize=decamelize;V.looksLikeNumber=looksLikeNumber;t.exports=V},2612:(t,s,b)=>{"use strict";var F=b(2613);class e extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}let B,T=[];function n(t,s,F,M){B=M;let R={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return R;const M=/\.json|\..*rc$/.test(t.extends);let U=null;if(M)U=function(t,s){return B.path.resolve(t,s)}(s,t.extends);else try{U=b(8501).resolve(t.extends)}catch(s){return t}!function(t){if(T.indexOf(t)>-1)throw new e(`Circular extended configurations: '${t}'.`)}(U),T.push(U),R=M?JSON.parse(B.readFileSync(U,"utf8")):b(8501)(t.extends),delete t.extends,R=n(R,B.path.dirname(U),F,B)}return T=[],F?r(R,t):Object.assign({},R,t)}function r(t,s){const b={};function i(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(b,t);for(const F of Object.keys(s))i(s[F])&&i(b[F])?b[F]=r(t[F],s[F]):b[F]=s[F];return b}function o(t){const s=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),b=/\.*[\][<>]/g,F=s.shift();if(!F)throw new Error(`No command found in: ${t}`);const B={cmd:F.replace(b,""),demanded:[],optional:[]};return s.forEach(((t,F)=>{let T=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&F===s.length-1&&(T=!0),/^\[/.test(t)?B.optional.push({cmd:t.replace(b,"").split("|"),variadic:T}):B.demanded.push({cmd:t.replace(b,"").split("|"),variadic:T})})),B}const M=["first","second","third","fourth","fifth","sixth"];function h(t,s,b){try{let F=0;const[B,T,M]="object"==typeof t?[{demanded:[],optional:[]},t,s]:[o(`cmd ${t}`),s,b],R=[].slice.call(T);for(;R.length&&void 0===R[R.length-1];)R.pop();const U=M||R.length;if(U<B.demanded.length)throw new e(`Not enough arguments provided. Expected ${B.demanded.length} but received ${R.length}.`);const L=B.demanded.length+B.optional.length;if(U>L)throw new e(`Too many arguments provided. Expected max ${L} but received ${U}.`);B.demanded.forEach((t=>{const s=l(R.shift());0===t.cmd.filter((t=>t===s||"*"===t)).length&&c(s,t.cmd,F),F+=1})),B.optional.forEach((t=>{if(0===R.length)return;const s=l(R.shift());0===t.cmd.filter((t=>t===s||"*"===t)).length&&c(s,t.cmd,F),F+=1}))}catch(t){console.warn(t.stack)}}function l(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function c(t,s,b){throw new e(`Invalid ${M[b]||"manyith"} argument. Expected ${s.join(" or ")} but received ${t}.`)}function f(t){return!!t&&!!t.then&&"function"==typeof t.then}function d(t,s,b,F){b.assert.notStrictEqual(t,s,F)}function u(t,s){s.assert.strictEqual(typeof t,"string")}function p(t){return Object.keys(t)}function g(t={},s=()=>!0){const b={};return p(t).forEach((F=>{s(F,t[F])&&(b[F]=t[F])})),b}function m(){return process.versions.electron&&!process.defaultApp?0:1}function y(){return process.argv[m()]}var R=Object.freeze({__proto__:null,hideBin:function(t){return t.slice(m()+1)},getProcessArgvBin:y});function v(t,s,b,F){if("a"===b&&!F)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof s?t!==s||!F:!s.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===b?F:"a"===b?F.call(t):F?F.value:s.get(t)}function O(t,s,b,F,B){if("m"===F)throw new TypeError("Private method is not writable");if("a"===F&&!B)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof s?t!==s||!B:!s.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===F?B.call(t,b):B?B.value=b:s.set(t,b),b}class w{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,s,b=!0,F=!1){if(h("<array|function> [boolean] [boolean] [boolean]",[t,s,b],arguments.length),Array.isArray(t)){for(let F=0;F<t.length;F++){if("function"!=typeof t[F])throw Error("middleware must be a function");const B=t[F];B.applyBeforeValidation=s,B.global=b}Array.prototype.push.apply(this.globalMiddleware,t)}else if("function"==typeof t){const B=t;B.applyBeforeValidation=s,B.global=b,B.mutates=F,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,s){const b=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((t=>{const F=[...b[s]||[],s];return!t.option||!F.includes(t.option)})),t.option=s,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function C(t,s,b,F){return b.reduce(((t,b)=>{if(b.applyBeforeValidation!==F)return t;if(b.mutates){if(b.applied)return t;b.applied=!0}if(f(t))return t.then((t=>Promise.all([t,b(t,s)]))).then((([t,s])=>Object.assign(t,s)));{const F=b(t,s);return f(F)?F.then((s=>Object.assign(t,s))):Object.assign(t,F)}}),t)}function j(t,s,b=t=>{throw t}){try{const b="function"==typeof t?t():t;return f(b)?b.then((t=>s(t))):s(b)}catch(t){return b(t)}}const U=/(^\*)|(^\$0)/;class _{constructor(t,s,b,F){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=F,this.usage=t,this.globalMiddleware=b,this.validation=s}addDirectory(t,s,b,F){"boolean"!=typeof(F=F||{}).recurse&&(F.recurse=!1),Array.isArray(F.extensions)||(F.extensions=["js"]);const B="function"==typeof F.visit?F.visit:t=>t;F.visit=(t,s,b)=>{const F=B(t,s,b);if(F){if(this.requireCache.has(s))return F;this.requireCache.add(s),this.addHandler(F)}return F},this.shim.requireDirectory({require:s,filename:b},t,F)}addHandler(t,s,b,F,B,T){let M=[];const R=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(B);if(F=F||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...M]=t;else for(const s of t)this.addHandler(s);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let s=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(s=[].concat(s).concat(t.aliases)),void this.addHandler(s,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(k(b))return void this.addHandler([t].concat(M),s,b.builder,b.handler,b.middlewares,b.deprecated)}if("string"==typeof t){const B=o(t);M=M.map((t=>o(t).cmd));let L=!1;const W=[B.cmd].concat(M).filter((t=>!U.test(t)||(L=!0,!1)));0===W.length&&L&&W.push("$0"),L&&(B.cmd=W[0],M=W.slice(1),t=t.replace(U,B.cmd)),M.forEach((t=>{this.aliasMap[t]=B.cmd})),!1!==s&&this.usage.command(t,s,L,M,T),this.handlers[B.cmd]={original:t,description:s,handler:F,builder:b||{},middlewares:R,deprecated:T,demanded:B.demanded,optional:B.optional},L&&(this.defaultCommand=this.handlers[B.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,s,b,F,B,T){const M=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,R=s.getInternalMethods().getContext(),U=R.commands.slice(),L=!t;t&&(R.commands.push(t),R.fullCommands.push(M.original));const W=this.applyBuilderUpdateUsageAndParse(L,M,s,b.aliases,U,F,B,T);return f(W)?W.then((t=>this.applyMiddlewareAndGetResult(L,M,t.innerArgv,R,B,t.aliases,s))):this.applyMiddlewareAndGetResult(L,M,W.innerArgv,R,B,W.aliases,s)}applyBuilderUpdateUsageAndParse(t,s,b,F,B,T,M,R){const U=s.builder;let L=b;if(x(U)){b.getInternalMethods().getUsageInstance().freeze();const W=U(b.getInternalMethods().reset(F),R);if(f(W))return W.then((F=>{var R;return L=(R=F)&&"function"==typeof R.getInternalMethods?F:b,this.parseAndUpdateUsage(t,s,L,B,T,M)}))}else(function(t){return"object"==typeof t})(U)&&(b.getInternalMethods().getUsageInstance().freeze(),L=b.getInternalMethods().reset(F),Object.keys(s.builder).forEach((t=>{L.option(t,U[t])})));return this.parseAndUpdateUsage(t,s,L,B,T,M)}parseAndUpdateUsage(t,s,b,F,B,T){t&&b.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(b)&&b.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(F,s),s.description);const M=b.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,B,T);return f(M)?M.then((t=>({aliases:b.parsed.aliases,innerArgv:t}))):{aliases:b.parsed.aliases,innerArgv:M}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,s){const b=U.test(s.original)?s.original.replace(U,"").trim():s.original,F=t.filter((t=>!U.test(t)));return F.push(b),`$0 ${F.join(" ")}`}handleValidationAndGetResult(t,s,b,F,B,T,M,R){if(!T.getInternalMethods().getHasOutput()){const s=T.getInternalMethods().runValidation(B,R,T.parsed.error,t);b=j(b,(t=>(s(t),t)))}if(s.handler&&!T.getInternalMethods().getHasOutput()){T.getInternalMethods().setHasOutput();const F=!!T.getOptions().configuration["populate--"];T.getInternalMethods().postProcess(b,F,!1,!1),b=j(b=C(b,T,M,!1),(t=>{const b=s.handler(t);return f(b)?b.then((()=>t)):t})),t||T.getInternalMethods().getUsageInstance().cacheHelpMessage(),f(b)&&!T.getInternalMethods().hasParseCallback()&&b.catch((t=>{try{T.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(F.commands.pop(),F.fullCommands.pop()),b}applyMiddlewareAndGetResult(t,s,b,F,B,T,M){let R={};if(B)return b;M.getInternalMethods().getHasOutput()||(R=this.populatePositionals(s,b,F,M));const U=this.globalMiddleware.getMiddleware().slice(0).concat(s.middlewares),L=C(b,M,U,!0);return f(L)?L.then((b=>this.handleValidationAndGetResult(t,s,b,F,T,M,U,R))):this.handleValidationAndGetResult(t,s,L,F,T,M,U,R)}populatePositionals(t,s,b,F){s._=s._.slice(b.commands.length);const B=t.demanded.slice(0),T=t.optional.slice(0),M={};for(this.validation.positionalCount(B.length,s._.length);B.length;){const t=B.shift();this.populatePositional(t,s,M)}for(;T.length;){const t=T.shift();this.populatePositional(t,s,M)}return s._=b.commands.concat(s._.map((t=>""+t))),this.postProcessPositionals(s,M,this.cmdToParseOptions(t.original),F),M}populatePositional(t,s,b){const F=t.cmd[0];t.variadic?b[F]=s._.splice(0).map(String):s._.length&&(b[F]=[String(s._.shift())])}cmdToParseOptions(t){const s={array:[],default:{},alias:{},demand:{}},b=o(t);return b.demanded.forEach((t=>{const[b,...F]=t.cmd;t.variadic&&(s.array.push(b),s.default[b]=[]),s.alias[b]=F,s.demand[b]=!0})),b.optional.forEach((t=>{const[b,...F]=t.cmd;t.variadic&&(s.array.push(b),s.default[b]=[]),s.alias[b]=F})),s}postProcessPositionals(t,s,b,F){const B=Object.assign({},F.getOptions());B.default=Object.assign(b.default,B.default);for(const t of Object.keys(b.alias))B.alias[t]=(B.alias[t]||[]).concat(b.alias[t]);B.array=B.array.concat(b.array),B.config={};const T=[];if(Object.keys(s).forEach((t=>{s[t].map((s=>{B.configuration["unknown-options-as-args"]&&(B.key[t]=!0),T.push(`--${t}`),T.push(s)}))})),!T.length)return;const M=Object.assign({},B.configuration,{"populate--":!1}),R=this.shim.Parser.detailed(T,Object.assign({},B,{configuration:M}));if(R.error)F.getInternalMethods().getUsageInstance().fail(R.error.message,R.error);else{const b=Object.keys(s);Object.keys(s).forEach((t=>{b.push(...R.aliases[t])})),Object.keys(R.argv).forEach((B=>{b.includes(B)&&(s[B]||(s[B]=R.argv[B]),!this.isInConfigs(F,B)&&!this.isDefaulted(F,B)&&Object.prototype.hasOwnProperty.call(t,B)&&Object.prototype.hasOwnProperty.call(R.argv,B)&&(Array.isArray(t[B])||Array.isArray(R.argv[B]))?t[B]=[].concat(t[B],R.argv[B]):t[B]=R.argv[B])}))}}isDefaulted(t,s){const{default:b}=t.getOptions();return Object.prototype.hasOwnProperty.call(b,s)||Object.prototype.hasOwnProperty.call(b,this.shim.Parser.camelCase(s))}isInConfigs(t,s){const{configObjects:b}=t.getOptions();return b.some((t=>Object.prototype.hasOwnProperty.call(t,s)))||b.some((t=>Object.prototype.hasOwnProperty.call(t,this.shim.Parser.camelCase(s))))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const s=U.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(s,this.defaultCommand.description)}const s=this.defaultCommand.builder;if(x(s))return s(t,!0);k(s)||Object.keys(s).forEach((b=>{t.option(b,s[b])}))}moduleName(t){const s=function(t){if(false){}for(let s,F=0,B=Object.keys(b.c);F<B.length;F++)if(s=b.c[B[F]],s.exports===t)return s;return null}(t);if(!s)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(s.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:s,desc:b}){for(const F of[t,s,b]){if("string"==typeof F||!1===F)return F;d(F,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();d(t,void 0,this.shim),({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t)}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function k(t){return"object"==typeof t&&!!t.builder&&"function"==typeof t.handler}function x(t){return"function"==typeof t}function E(t){"undefined"!=typeof process&&[process.stdout,process.stderr].forEach((s=>{const b=s;b._handle&&b.isTTY&&"function"==typeof b._handle.setBlocking&&b._handle.setBlocking(t)}))}function A(t){return"boolean"==typeof t}function P(t,s){const b=s.y18n.__,F={},B=[];F.failFn=function(t){B.push(t)};let T=null,M=null,R=!0;F.showHelpOnFail=function(s=!0,b){const[B,U]="string"==typeof s?[!0,s]:[s,b];return t.getInternalMethods().isGlobalContext()&&(M=U),T=U,R=B,F};let U=!1;F.fail=function(s,b){const L=t.getInternalMethods().getLoggerInstance();if(!B.length){if(t.getExitProcess()&&E(!0),!U){U=!0,R&&(t.showHelp("error"),L.error()),(s||b)&&L.error(s||b);const F=T||M;F&&((s||b)&&L.error(""),L.error(F))}if(b=b||new e(s),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,b);throw b}for(let t=B.length-1;t>=0;--t){const T=B[t];if(A(T)){if(b)throw b;if(s)throw Error(s)}else T(s,b,F)}};let L=[],W=!1;F.usage=(t,s)=>null===t?(W=!0,L=[],F):(W=!1,L.push([t,s||""]),F),F.getUsage=()=>L,F.getUsageDisabled=()=>W,F.getPositionalGroupName=()=>b("Positionals:");let K=[];F.example=(t,s)=>{K.push([t,s||""])};let z=[];F.command=function(t,s,b,F,B=!1){b&&(z=z.map((t=>(t[2]=!1,t)))),z.push([t,s||"",b,F,B])},F.getCommands=()=>z;let G={};F.describe=function(t,s){Array.isArray(t)?t.forEach((t=>{F.describe(t,s)})):"object"==typeof t?Object.keys(t).forEach((s=>{F.describe(s,t[s])})):G[t]=s},F.getDescriptions=()=>G;let H=[];F.epilog=t=>{H.push(t)};let V,q=!1;F.wrap=t=>{q=!0,V=t},F.getWrap=()=>s.getEnv("YARGS_DISABLE_WRAP")?null:(q||(V=function(){const t=80;return s.process.stdColumns?Math.min(t,s.process.stdColumns):t}(),q=!0),V);const J="__yargsString__:";function O(t,b,F){let B=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{B=Math.max(s.stringWidth(F?`${F} ${I(t[0])}`:I(t[0]))+$(t[0]),B)})),b&&(B=Math.min(B,parseInt((.5*b).toString(),10))),B}let Y;function C(s){return t.getOptions().hiddenOptions.indexOf(s)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function j(t,s){let F=`[${b("default:")} `;if(void 0===t&&!s)return null;if(s)F+=s;else switch(typeof t){case"string":F+=`"${t}"`;break;case"object":F+=JSON.stringify(t);break;default:F+=t}return`${F}]`}F.deferY18nLookup=t=>J+t,F.help=function(){if(Y)return Y;!function(){const s=t.getDemandedOptions(),b=t.getOptions();(Object.keys(b.alias)||[]).forEach((B=>{b.alias[B].forEach((T=>{G[T]&&F.describe(B,G[T]),T in s&&t.demandOption(B,s[T]),b.boolean.includes(T)&&t.boolean(B),b.count.includes(T)&&t.count(B),b.string.includes(T)&&t.string(B),b.normalize.includes(T)&&t.normalize(B),b.array.includes(T)&&t.array(B),b.number.includes(T)&&t.number(B)}))}))}();const B=t.customScriptName?t.$0:s.path.basename(t.$0),T=t.getDemandedOptions(),M=t.getDemandedCommands(),R=t.getDeprecatedOptions(),U=t.getGroups(),V=t.getOptions();let q=[];q=q.concat(Object.keys(G)),q=q.concat(Object.keys(T)),q=q.concat(Object.keys(M)),q=q.concat(Object.keys(V.default)),q=q.filter(C),q=Object.keys(q.reduce(((t,s)=>("_"!==s&&(t[s]=!0),t)),{}));const X=F.getWrap(),Z=s.cliui({width:X,wrap:!!X});if(!W)if(L.length)L.forEach((t=>{Z.div({text:`${t[0].replace(/\$0/g,B)}`}),t[1]&&Z.div({text:`${t[1]}`,padding:[1,0,0,0]})})),Z.div();else if(z.length){let t=null;t=M._?`${B} <${b("command")}>\n`:`${B} [${b("command")}]\n`,Z.div(`${t}`)}if(z.length>1||1===z.length&&!z[0][2]){Z.div(b("Commands:"));const s=t.getInternalMethods().getContext(),F=s.commands.length?`${s.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(z=z.sort(((t,s)=>t[0].localeCompare(s[0]))));const T=B?`${B} `:"";z.forEach((t=>{const s=`${T}${F}${t[0].replace(/^\$0 ?/,"")}`;Z.span({text:s,padding:[0,2,0,2],width:O(z,X,`${B}${F}`)+4},{text:t[1]});const M=[];t[2]&&M.push(`[${b("default")}]`),t[3]&&t[3].length&&M.push(`[${b("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?M.push(`[${b("deprecated: %s",t[4])}]`):M.push(`[${b("deprecated")}]`)),M.length?Z.div({text:M.join(" "),padding:[0,0,0,2],align:"right"}):Z.div()})),Z.div()}const Q=(Object.keys(V.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);q=q.filter((s=>!t.parsed.newAliases[s]&&Q.every((t=>-1===(V.alias[t]||[]).indexOf(s)))));const ee=b("Options:");U[ee]||(U[ee]=[]),function(t,s,b,F){let B=[],T=null;Object.keys(b).forEach((t=>{B=B.concat(b[t])})),t.forEach((t=>{T=[t].concat(s[t]),T.some((t=>-1!==B.indexOf(t)))||b[F].push(t)}))}(q,V.alias,U,ee);const k=t=>/^--/.test(I(t)),re=Object.keys(U).filter((t=>U[t].length>0)).map((t=>({groupName:t,normalizedKeys:U[t].filter(C).map((t=>{if(Q.includes(t))return t;for(let s,b=0;void 0!==(s=Q[b]);b++)if((V.alias[s]||[]).includes(t))return s;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:s})=>{const b=s.reduce(((s,b)=>(s[b]=[b].concat(V.alias[b]||[]).map((s=>t===F.getPositionalGroupName()?s:(/^[0-9]$/.test(s)?V.boolean.includes(b)?"-":"--":s.length>1?"--":"-")+s)).sort(((t,s)=>k(t)===k(s)?0:k(t)?1:-1)).join(", "),s)),{});return{groupName:t,normalizedKeys:s,switches:b}}));if(re.filter((({groupName:t})=>t!==F.getPositionalGroupName())).some((({normalizedKeys:t,switches:s})=>!t.every((t=>k(s[t])))))&&re.filter((({groupName:t})=>t!==F.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:s})=>{t.forEach((t=>{var b,F;k(s[t])&&(s[t]=(b=s[t],F=4,S(b)?{text:b.text,indentation:b.indentation+F}:{text:b,indentation:F}))}))})),re.forEach((({groupName:s,normalizedKeys:B,switches:M})=>{Z.div(s),B.forEach((s=>{const B=M[s];let U=G[s]||"",L=null;U.includes(J)&&(U=b(U.substring(16))),V.boolean.includes(s)&&(L=`[${b("boolean")}]`),V.count.includes(s)&&(L=`[${b("count")}]`),V.string.includes(s)&&(L=`[${b("string")}]`),V.normalize.includes(s)&&(L=`[${b("string")}]`),V.array.includes(s)&&(L=`[${b("array")}]`),V.number.includes(s)&&(L=`[${b("number")}]`);const W=[s in R?(K=R[s],"string"==typeof K?`[${b("deprecated: %s",K)}]`:`[${b("deprecated")}]`):null,L,s in T?`[${b("required")}]`:null,V.choices&&V.choices[s]?`[${b("choices:")} ${F.stringifiedValues(V.choices[s])}]`:null,j(V.default[s],V.defaultDescription[s])].filter(Boolean).join(" ");var K;Z.span({text:I(B),padding:[0,2,0,2+$(B)],width:O(M,X)+4},U);const z=!0===t.getInternalMethods().getUsageConfiguration()["hide-types"];W&&!z?Z.div({text:W,padding:[0,0,0,2],align:"right"}):Z.div()})),Z.div()})),K.length&&(Z.div(b("Examples:")),K.forEach((t=>{t[0]=t[0].replace(/\$0/g,B)})),K.forEach((t=>{""===t[1]?Z.div({text:t[0],padding:[0,2,0,2]}):Z.div({text:t[0],padding:[0,2,0,2],width:O(K,X)+4},{text:t[1]})})),Z.div()),H.length>0){const t=H.map((t=>t.replace(/\$0/g,B))).join("\n");Z.div(`${t}\n`)}return Z.toString().replace(/\s*$/,"")},F.cacheHelpMessage=function(){Y=this.help()},F.clearCachedHelpMessage=function(){Y=void 0},F.hasCachedHelpMessage=function(){return!!Y},F.showHelp=s=>{const b=t.getInternalMethods().getLoggerInstance();s||(s="error");("function"==typeof s?s:b[s])(F.help())},F.functionDescription=t=>["(",t.name?s.Parser.decamelize(t.name,"-"):b("generated-value"),")"].join(""),F.stringifiedValues=function(t,s){let b="";const F=s||", ",B=[].concat(t);return t&&B.length?(B.forEach((t=>{b.length&&(b+=F),b+=JSON.stringify(t)})),b):b};let X=null;F.version=t=>{X=t},F.showVersion=s=>{const b=t.getInternalMethods().getLoggerInstance();s||(s="error");("function"==typeof s?s:b[s])(X)},F.reset=function(t){return T=null,U=!1,L=[],W=!1,H=[],K=[],z=[],G=g(G,(s=>!t[s])),F};const Z=[];return F.freeze=function(){Z.push({failMessage:T,failureOutput:U,usages:L,usageDisabled:W,epilogs:H,examples:K,commands:z,descriptions:G})},F.unfreeze=function(t=!1){const s=Z.pop();s&&(t?(G={...s.descriptions,...G},z=[...s.commands,...z],L=[...s.usages,...L],K=[...s.examples,...K],H=[...s.epilogs,...H]):({failMessage:T,failureOutput:U,usages:L,usageDisabled:W,epilogs:H,examples:K,commands:z,descriptions:G}=s))},F}function S(t){return"object"==typeof t}function $(t){return S(t)?t.indentation:0}function I(t){return S(t)?t.text:t}class D{constructor(t,s,b,F){var B,T,M;this.yargs=t,this.usage=s,this.command=b,this.shim=F,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(M=(null===(B=this.shim.getEnv("SHELL"))||void 0===B?void 0:B.includes("zsh"))||(null===(T=this.shim.getEnv("ZSH_NAME"))||void 0===T?void 0:T.includes("zsh")))&&void 0!==M&&M}defaultCompletion(t,s,b,F){const B=this.command.getCommandHandlers();for(let s=0,b=t.length;s<b;++s)if(B[t[s]]&&B[t[s]].builder){const b=B[t[s]].builder;if(x(b)){this.indexAfterLastReset=s+1;const t=this.yargs.getInternalMethods().reset();return b(t,!0),t.argv}}const T=[];this.commandCompletions(T,t,b),this.optionCompletions(T,t,s,b),this.choicesFromOptionsCompletions(T,t,s,b),this.choicesFromPositionalsCompletions(T,t,s,b),F(null,T)}commandCompletions(t,s,b){const F=this.yargs.getInternalMethods().getContext().commands;b.match(/^-/)||F[F.length-1]===b||this.previousArgHasChoices(s)||this.usage.getCommands().forEach((b=>{const F=o(b[0]).cmd;if(-1===s.indexOf(F))if(this.zshShell){const s=b[1]||"";t.push(F.replace(/:/g,"\\:")+":"+s)}else t.push(F)}))}optionCompletions(t,s,b,F){if((F.match(/^-/)||""===F&&0===t.length)&&!this.previousArgHasChoices(s)){const b=this.yargs.getOptions(),B=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(b.key).forEach((T=>{const M=!!b.configuration["boolean-negation"]&&b.boolean.includes(T);B.includes(T)||b.hiddenOptions.includes(T)||this.argsContainKey(s,T,M)||this.completeOptionKey(T,t,F,M&&!!b.default[T])}))}}choicesFromOptionsCompletions(t,s,b,F){if(this.previousArgHasChoices(s)){const b=this.getPreviousArgChoices(s);b&&b.length>0&&t.push(...b.map((t=>t.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(t,s,b,F){if(""===F&&t.length>0&&this.previousArgHasChoices(s))return;const B=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],T=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),M=B[b._.length-T-1];if(!M)return;const R=this.yargs.getOptions().choices[M]||[];for(const s of R)s.startsWith(F)&&t.push(s.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let s=t[t.length-1],b="";if(!s.startsWith("-")&&t.length>1&&(b=s,s=t[t.length-2]),!s.startsWith("-"))return;const F=s.replace(/^-+/,""),B=this.yargs.getOptions(),T=[F,...this.yargs.getAliases()[F]||[]];let M;for(const t of T)if(Object.prototype.hasOwnProperty.call(B.key,t)&&Array.isArray(B.choices[t])){M=B.choices[t];break}return M?M.filter((t=>!b||t.startsWith(b))):void 0}previousArgHasChoices(t){const s=this.getPreviousArgChoices(t);return void 0!==s&&s.length>0}argsContainKey(t,s,b){const i=s=>-1!==t.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s);if(i(s))return!0;if(b&&i(`no-${s}`))return!0;if(this.aliases)for(const t of this.aliases[s])if(i(t))return!0;return!1}completeOptionKey(t,s,b,F){var B,T,M,R;let U=t;if(this.zshShell){const s=this.usage.getDescriptions(),b=null===(T=null===(B=null==this?void 0:this.aliases)||void 0===B?void 0:B[t])||void 0===T?void 0:T.find((t=>{const b=s[t];return"string"==typeof b&&b.length>0})),F=b?s[b]:void 0,L=null!==(R=null!==(M=s[t])&&void 0!==M?M:F)&&void 0!==R?R:"";U=`${t.replace(/:/g,"\\:")}:${L.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const L=!/^--/.test(b)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";s.push(L+U),F&&s.push(L+"no-"+U)}customCompletion(t,s,b,F){if(d(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(b,s);return f(t)?t.then((t=>{this.shim.process.nextTick((()=>{F(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{F(t,void 0)}))})):F(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(b,s,((B=F)=>this.defaultCompletion(t,s,b,B)),(t=>{F(null,t)})):this.customCompletionFunction(b,s,(t=>{F(null,t)}))}getCompletion(t,s){const b=t.length?t[t.length-1]:"",F=this.yargs.parse(t,!0),B=this.customCompletionFunction?F=>this.customCompletion(t,F,b,s):F=>this.defaultCompletion(t,F,b,s);return f(F)?F.then(B):B(F)}generateCompletionScript(t,s){let b=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const F=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),b=b.replace(/{{app_name}}/g,F),b=b.replace(/{{completion_command}}/g,s),b.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function N(t,s){if(0===t.length)return s.length;if(0===s.length)return t.length;const b=[];let F,B;for(F=0;F<=s.length;F++)b[F]=[F];for(B=0;B<=t.length;B++)b[0][B]=B;for(F=1;F<=s.length;F++)for(B=1;B<=t.length;B++)s.charAt(F-1)===t.charAt(B-1)?b[F][B]=b[F-1][B-1]:F>1&&B>1&&s.charAt(F-2)===t.charAt(B-1)&&s.charAt(F-1)===t.charAt(B-2)?b[F][B]=b[F-2][B-2]+1:b[F][B]=Math.min(b[F-1][B-1]+1,Math.min(b[F][B-1]+1,b[F-1][B]+1));return b[s.length][t.length]}const L=["$0","--","_"];var W,K,z,G,H,V,q,J,Y,X,Z,Q,ee,re,ne,oe,ie,se,ae,ue,ce,le,fe,de,pe,he,ge,me,De,ye,be,ve,we,Ee,Oe;const Ce=Symbol("copyDoubleDash"),Ae=Symbol("copyDoubleDash"),Se=Symbol("deleteFromParserHintObject"),ke=Symbol("emitWarning"),je=Symbol("freeze"),Fe=Symbol("getDollarZero"),xe=Symbol("getParserConfiguration"),_e=Symbol("getUsageConfiguration"),Pe=Symbol("guessLocale"),Ie=Symbol("guessVersion"),Be=Symbol("parsePositionalNumbers"),Te=Symbol("pkgUp"),Me=Symbol("populateParserHintArray"),Ne=Symbol("populateParserHintSingleValueDictionary"),Re=Symbol("populateParserHintArrayDictionary"),$e=Symbol("populateParserHintDictionary"),Ue=Symbol("sanitizeKey"),Le=Symbol("setKey"),We=Symbol("unfreeze"),Ke=Symbol("validateAsync"),ze=Symbol("getCommandInstance"),Ge=Symbol("getContext"),He=Symbol("getHasOutput"),Ve=Symbol("getLoggerInstance"),qe=Symbol("getParseContext"),Je=Symbol("getUsageInstance"),Ye=Symbol("getValidationInstance"),Xe=Symbol("hasParseCallback"),Ze=Symbol("isGlobalContext"),Qe=Symbol("postProcess"),et=Symbol("rebase"),tt=Symbol("reset"),rt=Symbol("runYargsParserAndExecuteCommands"),nt=Symbol("runValidation"),ot=Symbol("setHasOutput"),it=Symbol("kTrackManuallySetKeys");class te{constructor(t=[],s,b,F){this.customScriptName=!1,this.parsed=!1,W.set(this,void 0),K.set(this,void 0),z.set(this,{commands:[],fullCommands:[]}),G.set(this,null),H.set(this,null),V.set(this,"show-hidden"),q.set(this,null),J.set(this,!0),Y.set(this,{}),X.set(this,!0),Z.set(this,[]),Q.set(this,void 0),ee.set(this,{}),re.set(this,!1),ne.set(this,null),oe.set(this,!0),ie.set(this,void 0),se.set(this,""),ae.set(this,void 0),ue.set(this,void 0),ce.set(this,{}),le.set(this,null),fe.set(this,null),de.set(this,{}),pe.set(this,{}),he.set(this,void 0),ge.set(this,!1),me.set(this,void 0),De.set(this,!1),ye.set(this,!1),be.set(this,!1),ve.set(this,void 0),we.set(this,{}),Ee.set(this,null),Oe.set(this,void 0),O(this,me,F,"f"),O(this,he,t,"f"),O(this,K,s,"f"),O(this,ue,b,"f"),O(this,Q,new w(this),"f"),this.$0=this[Fe](),this[tt](),O(this,W,v(this,W,"f"),"f"),O(this,ve,v(this,ve,"f"),"f"),O(this,Oe,v(this,Oe,"f"),"f"),O(this,ae,v(this,ae,"f"),"f"),v(this,ae,"f").showHiddenOpt=v(this,V,"f"),O(this,ie,this[Ae](),"f")}addHelpOpt(t,s){return h("[string|boolean] [string]",[t,s],arguments.length),v(this,ne,"f")&&(this[Se](v(this,ne,"f")),O(this,ne,null,"f")),!1===t&&void 0===s||(O(this,ne,"string"==typeof t?t:"help","f"),this.boolean(v(this,ne,"f")),this.describe(v(this,ne,"f"),s||v(this,ve,"f").deferY18nLookup("Show help"))),this}help(t,s){return this.addHelpOpt(t,s)}addShowHiddenOpt(t,s){if(h("[string|boolean] [string]",[t,s],arguments.length),!1===t&&void 0===s)return this;const b="string"==typeof t?t:v(this,V,"f");return this.boolean(b),this.describe(b,s||v(this,ve,"f").deferY18nLookup("Show hidden options")),v(this,ae,"f").showHiddenOpt=b,this}showHidden(t,s){return this.addShowHiddenOpt(t,s)}alias(t,s){return h("<object|string|array> [string|array]",[t,s],arguments.length),this[Re](this.alias.bind(this),"alias",t,s),this}array(t){return h("<array|string>",[t],arguments.length),this[Me]("array",t),this[it](t),this}boolean(t){return h("<array|string>",[t],arguments.length),this[Me]("boolean",t),this[it](t),this}check(t,s){return h("<function> [boolean]",[t,s],arguments.length),this.middleware(((s,b)=>j((()=>t(s,b.getOptions())),(b=>(b?("string"==typeof b||b instanceof Error)&&v(this,ve,"f").fail(b.toString(),b):v(this,ve,"f").fail(v(this,me,"f").y18n.__("Argument check failed: %s",t.toString())),s)),(t=>(v(this,ve,"f").fail(t.message?t.message:t.toString(),t),s)))),!1,s),this}choices(t,s){return h("<object|string|array> [string|array]",[t,s],arguments.length),this[Re](this.choices.bind(this),"choices",t,s),this}coerce(t,s){if(h("<object|string|array> [function]",[t,s],arguments.length),Array.isArray(t)){if(!s)throw new e("coerce callback must be provided");for(const b of t)this.coerce(b,s);return this}if("object"==typeof t){for(const s of Object.keys(t))this.coerce(s,t[s]);return this}if(!s)throw new e("coerce callback must be provided");return v(this,ae,"f").key[t]=!0,v(this,Q,"f").addCoerceMiddleware(((b,F)=>{let B;return Object.prototype.hasOwnProperty.call(b,t)?j((()=>(B=F.getAliases(),s(b[t]))),(s=>{b[t]=s;const T=F.getInternalMethods().getParserConfiguration()["strip-aliased"];if(B[t]&&!0!==T)for(const F of B[t])b[F]=s;return b}),(t=>{throw new e(t.message)})):b}),t),this}conflicts(t,s){return h("<string|object> [string|array]",[t,s],arguments.length),v(this,Oe,"f").conflicts(t,s),this}config(t="config",s,b){return h("[object|string] [string|function] [function]",[t,s,b],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof s&&(b=s,s=void 0),this.describe(t,s||v(this,ve,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{v(this,ae,"f").config[t]=b||!0})),this):(t=n(t,v(this,K,"f"),this[xe]()["deep-merge-config"]||!1,v(this,me,"f")),v(this,ae,"f").configObjects=(v(this,ae,"f").configObjects||[]).concat(t),this)}completion(t,s,b){return h("[string] [string|boolean|function] [function]",[t,s,b],arguments.length),"function"==typeof s&&(b=s,s=void 0),O(this,H,t||v(this,H,"f")||"completion","f"),s||!1===s||(s="generate completion script"),this.command(v(this,H,"f"),s),b&&v(this,G,"f").registerFunction(b),this}command(t,s,b,F,B,T){return h("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,s,b,F,B,T],arguments.length),v(this,W,"f").addHandler(t,s,b,F,B,T),this}commands(t,s,b,F,B,T){return this.command(t,s,b,F,B,T)}commandDir(t,s){h("<string> [object]",[t,s],arguments.length);const b=v(this,ue,"f")||v(this,me,"f").require;return v(this,W,"f").addDirectory(t,b,v(this,me,"f").getCallerFile(),s),this}count(t){return h("<array|string>",[t],arguments.length),this[Me]("count",t),this[it](t),this}default(t,s,b){return h("<object|string|array> [*] [string]",[t,s,b],arguments.length),b&&(u(t,v(this,me,"f")),v(this,ae,"f").defaultDescription[t]=b),"function"==typeof s&&(u(t,v(this,me,"f")),v(this,ae,"f").defaultDescription[t]||(v(this,ae,"f").defaultDescription[t]=v(this,ve,"f").functionDescription(s)),s=s.call()),this[Ne](this.default.bind(this),"default",t,s),this}defaults(t,s,b){return this.default(t,s,b)}demandCommand(t=1,s,b,F){return h("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,s,b,F],arguments.length),"number"!=typeof s&&(b=s,s=1/0),this.global("_",!1),v(this,ae,"f").demandedCommands._={min:t,max:s,minMsg:b,maxMsg:F},this}demand(t,s,b){return Array.isArray(s)?(s.forEach((t=>{d(b,!0,v(this,me,"f")),this.demandOption(t,b)})),s=1/0):"number"!=typeof s&&(b=s,s=1/0),"number"==typeof t?(d(b,!0,v(this,me,"f")),this.demandCommand(t,s,b,b)):Array.isArray(t)?t.forEach((t=>{d(b,!0,v(this,me,"f")),this.demandOption(t,b)})):"string"==typeof b?this.demandOption(t,b):!0!==b&&void 0!==b||this.demandOption(t),this}demandOption(t,s){return h("<object|string|array> [string]",[t,s],arguments.length),this[Ne](this.demandOption.bind(this),"demandedOptions",t,s),this}deprecateOption(t,s){return h("<string> [string|boolean]",[t,s],arguments.length),v(this,ae,"f").deprecatedOptions[t]=s,this}describe(t,s){return h("<object|string|array> [string]",[t,s],arguments.length),this[Le](t,!0),v(this,ve,"f").describe(t,s),this}detectLocale(t){return h("<boolean>",[t],arguments.length),O(this,J,t,"f"),this}env(t){return h("[string|boolean]",[t],arguments.length),!1===t?delete v(this,ae,"f").envPrefix:v(this,ae,"f").envPrefix=t||"",this}epilogue(t){return h("<string>",[t],arguments.length),v(this,ve,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,s){return h("<string|array> [string]",[t,s],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):v(this,ve,"f").example(t,s),this}exit(t,s){O(this,re,!0,"f"),O(this,q,s,"f"),v(this,X,"f")&&v(this,me,"f").process.exit(t)}exitProcess(t=!0){return h("[boolean]",[t],arguments.length),O(this,X,t,"f"),this}fail(t){if(h("<function|boolean>",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new e("Invalid first argument. Expected function or boolean 'false'");return v(this,ve,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,s){return h("<array> [function]",[t,s],arguments.length),s?v(this,G,"f").getCompletion(t,s):new Promise(((s,b)=>{v(this,G,"f").getCompletion(t,((t,F)=>{t?b(t):s(F)}))}))}getDemandedOptions(){return h([],0),v(this,ae,"f").demandedOptions}getDemandedCommands(){return h([],0),v(this,ae,"f").demandedCommands}getDeprecatedOptions(){return h([],0),v(this,ae,"f").deprecatedOptions}getDetectLocale(){return v(this,J,"f")}getExitProcess(){return v(this,X,"f")}getGroups(){return Object.assign({},v(this,ee,"f"),v(this,pe,"f"))}getHelp(){if(O(this,re,!0,"f"),!v(this,ve,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[rt](v(this,he,"f"),void 0,void 0,0,!0);if(f(t))return t.then((()=>v(this,ve,"f").help()))}const t=v(this,W,"f").runDefaultBuilderOn(this);if(f(t))return t.then((()=>v(this,ve,"f").help()))}return Promise.resolve(v(this,ve,"f").help())}getOptions(){return v(this,ae,"f")}getStrict(){return v(this,De,"f")}getStrictCommands(){return v(this,ye,"f")}getStrictOptions(){return v(this,be,"f")}global(t,s){return h("<string|array> [boolean]",[t,s],arguments.length),t=[].concat(t),!1!==s?v(this,ae,"f").local=v(this,ae,"f").local.filter((s=>-1===t.indexOf(s))):t.forEach((t=>{v(this,ae,"f").local.includes(t)||v(this,ae,"f").local.push(t)})),this}group(t,s){h("<string|array> <string>",[t,s],arguments.length);const b=v(this,pe,"f")[s]||v(this,ee,"f")[s];v(this,pe,"f")[s]&&delete v(this,pe,"f")[s];const F={};return v(this,ee,"f")[s]=(b||[]).concat(t).filter((t=>!F[t]&&(F[t]=!0))),this}hide(t){return h("<string>",[t],arguments.length),v(this,ae,"f").hiddenOptions.push(t),this}implies(t,s){return h("<string|object> [number|string|array]",[t,s],arguments.length),v(this,Oe,"f").implies(t,s),this}locale(t){return h("[string]",[t],arguments.length),void 0===t?(this[Pe](),v(this,me,"f").y18n.getLocale()):(O(this,J,!1,"f"),v(this,me,"f").y18n.setLocale(t),this)}middleware(t,s,b){return v(this,Q,"f").addMiddleware(t,!!s,b)}nargs(t,s){return h("<string|object|array> [number]",[t,s],arguments.length),this[Ne](this.nargs.bind(this),"narg",t,s),this}normalize(t){return h("<array|string>",[t],arguments.length),this[Me]("normalize",t),this}number(t){return h("<array|string>",[t],arguments.length),this[Me]("number",t),this[it](t),this}option(t,s){if(h("<string|object> [object]",[t,s],arguments.length),"object"==typeof t)Object.keys(t).forEach((s=>{this.options(s,t[s])}));else{"object"!=typeof s&&(s={}),this[it](t),!v(this,Ee,"f")||"version"!==t&&"version"!==(null==s?void 0:s.alias)||this[ke](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),void 0,"versionWarning"),v(this,ae,"f").key[t]=!0,s.alias&&this.alias(t,s.alias);const b=s.deprecate||s.deprecated;b&&this.deprecateOption(t,b);const F=s.demand||s.required||s.require;F&&this.demand(t,F),s.demandOption&&this.demandOption(t,"string"==typeof s.demandOption?s.demandOption:void 0),s.conflicts&&this.conflicts(t,s.conflicts),"default"in s&&this.default(t,s.default),void 0!==s.implies&&this.implies(t,s.implies),void 0!==s.nargs&&this.nargs(t,s.nargs),s.config&&this.config(t,s.configParser),s.normalize&&this.normalize(t),s.choices&&this.choices(t,s.choices),s.coerce&&this.coerce(t,s.coerce),s.group&&this.group(t,s.group),(s.boolean||"boolean"===s.type)&&(this.boolean(t),s.alias&&this.boolean(s.alias)),(s.array||"array"===s.type)&&(this.array(t),s.alias&&this.array(s.alias)),(s.number||"number"===s.type)&&(this.number(t),s.alias&&this.number(s.alias)),(s.string||"string"===s.type)&&(this.string(t),s.alias&&this.string(s.alias)),(s.count||"count"===s.type)&&this.count(t),"boolean"==typeof s.global&&this.global(t,s.global),s.defaultDescription&&(v(this,ae,"f").defaultDescription[t]=s.defaultDescription),s.skipValidation&&this.skipValidation(t);const B=s.describe||s.description||s.desc,T=v(this,ve,"f").getDescriptions();Object.prototype.hasOwnProperty.call(T,t)&&"string"!=typeof B||this.describe(t,B),s.hidden&&this.hide(t),s.requiresArg&&this.requiresArg(t)}return this}options(t,s){return this.option(t,s)}parse(t,s,b){h("[string|array] [function|boolean|object] [function]",[t,s,b],arguments.length),this[je](),void 0===t&&(t=v(this,he,"f")),"object"==typeof s&&(O(this,fe,s,"f"),s=b),"function"==typeof s&&(O(this,le,s,"f"),s=!1),s||O(this,he,t,"f"),v(this,le,"f")&&O(this,X,!1,"f");const F=this[rt](t,!!s),B=this.parsed;return v(this,G,"f").setParsed(this.parsed),f(F)?F.then((t=>(v(this,le,"f")&&v(this,le,"f").call(this,v(this,q,"f"),t,v(this,se,"f")),t))).catch((t=>{throw v(this,le,"f")&&v(this,le,"f")(t,this.parsed.argv,v(this,se,"f")),t})).finally((()=>{this[We](),this.parsed=B})):(v(this,le,"f")&&v(this,le,"f").call(this,v(this,q,"f"),F,v(this,se,"f")),this[We](),this.parsed=B,F)}parseAsync(t,s,b){const F=this.parse(t,s,b);return f(F)?F:Promise.resolve(F)}parseSync(t,s,b){const F=this.parse(t,s,b);if(f(F))throw new e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return F}parserConfiguration(t){return h("<object>",[t],arguments.length),O(this,ce,t,"f"),this}pkgConf(t,s){h("<string> [string]",[t,s],arguments.length);let b=null;const F=this[Te](s||v(this,K,"f"));return F[t]&&"object"==typeof F[t]&&(b=n(F[t],s||v(this,K,"f"),this[xe]()["deep-merge-config"]||!1,v(this,me,"f")),v(this,ae,"f").configObjects=(v(this,ae,"f").configObjects||[]).concat(b)),this}positional(t,s){h("<string> <object>",[t,s],arguments.length);const b=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];s=g(s,((t,s)=>!("type"===t&&!["string","number","boolean"].includes(s))&&b.includes(t)));const F=v(this,z,"f").fullCommands[v(this,z,"f").fullCommands.length-1],B=F?v(this,W,"f").cmdToParseOptions(F):{array:[],alias:{},default:{},demand:{}};return p(B).forEach((b=>{const F=B[b];Array.isArray(F)?-1!==F.indexOf(t)&&(s[b]=!0):F[t]&&!(b in s)&&(s[b]=F[t])})),this.group(t,v(this,ve,"f").getPositionalGroupName()),this.option(t,s)}recommendCommands(t=!0){return h("[boolean]",[t],arguments.length),O(this,ge,t,"f"),this}required(t,s,b){return this.demand(t,s,b)}require(t,s,b){return this.demand(t,s,b)}requiresArg(t){return h("<array|string|object> [number]",[t],arguments.length),"string"==typeof t&&v(this,ae,"f").narg[t]||this[Ne](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,s){return h("[string] [string]",[t,s],arguments.length),t=t||this.$0,v(this,ie,"f").log(v(this,G,"f").generateCompletionScript(t,s||v(this,H,"f")||"completion")),this}showHelp(t){if(h("[string|function]",[t],arguments.length),O(this,re,!0,"f"),!v(this,ve,"f").hasCachedHelpMessage()){if(!this.parsed){const s=this[rt](v(this,he,"f"),void 0,void 0,0,!0);if(f(s))return s.then((()=>{v(this,ve,"f").showHelp(t)})),this}const s=v(this,W,"f").runDefaultBuilderOn(this);if(f(s))return s.then((()=>{v(this,ve,"f").showHelp(t)})),this}return v(this,ve,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,s){return h("[boolean|string] [string]",[t,s],arguments.length),v(this,ve,"f").showHelpOnFail(t,s),this}showVersion(t){return h("[string|function]",[t],arguments.length),v(this,ve,"f").showVersion(t),this}skipValidation(t){return h("<array|string>",[t],arguments.length),this[Me]("skipValidation",t),this}strict(t){return h("[boolean]",[t],arguments.length),O(this,De,!1!==t,"f"),this}strictCommands(t){return h("[boolean]",[t],arguments.length),O(this,ye,!1!==t,"f"),this}strictOptions(t){return h("[boolean]",[t],arguments.length),O(this,be,!1!==t,"f"),this}string(t){return h("<array|string>",[t],arguments.length),this[Me]("string",t),this[it](t),this}terminalWidth(){return h([],0),v(this,me,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return h("<object>",[t],arguments.length),O(this,J,!1,"f"),v(this,me,"f").y18n.updateLocale(t),this}usage(t,s,b,F){if(h("<string|null|undefined> [string|boolean] [function|object] [function]",[t,s,b,F],arguments.length),void 0!==s){if(d(t,null,v(this,me,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,s,b,F);throw new e(".usage() description must start with $0 if being used as alias for .command()")}return v(this,ve,"f").usage(t),this}usageConfiguration(t){return h("<object>",[t],arguments.length),O(this,we,t,"f"),this}version(t,s,b){const F="version";if(h("[boolean|string] [string] [string]",[t,s,b],arguments.length),v(this,Ee,"f")&&(this[Se](v(this,Ee,"f")),v(this,ve,"f").version(void 0),O(this,Ee,null,"f")),0===arguments.length)b=this[Ie](),t=F;else if(1===arguments.length){if(!1===t)return this;b=t,t=F}else 2===arguments.length&&(b=s,s=void 0);return O(this,Ee,"string"==typeof t?t:F,"f"),s=s||v(this,ve,"f").deferY18nLookup("Show version number"),v(this,ve,"f").version(b||void 0),this.boolean(v(this,Ee,"f")),this.describe(v(this,Ee,"f"),s),this}wrap(t){return h("<number|null|undefined>",[t],arguments.length),v(this,ve,"f").wrap(t),this}[(W=new WeakMap,K=new WeakMap,z=new WeakMap,G=new WeakMap,H=new WeakMap,V=new WeakMap,q=new WeakMap,J=new WeakMap,Y=new WeakMap,X=new WeakMap,Z=new WeakMap,Q=new WeakMap,ee=new WeakMap,re=new WeakMap,ne=new WeakMap,oe=new WeakMap,ie=new WeakMap,se=new WeakMap,ae=new WeakMap,ue=new WeakMap,ce=new WeakMap,le=new WeakMap,fe=new WeakMap,de=new WeakMap,pe=new WeakMap,he=new WeakMap,ge=new WeakMap,me=new WeakMap,De=new WeakMap,ye=new WeakMap,be=new WeakMap,ve=new WeakMap,we=new WeakMap,Ee=new WeakMap,Oe=new WeakMap,Ce)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[Ae](){return{log:(...t)=>{this[Xe]()||console.log(...t),O(this,re,!0,"f"),v(this,se,"f").length&&O(this,se,v(this,se,"f")+"\n","f"),O(this,se,v(this,se,"f")+t.join(" "),"f")},error:(...t)=>{this[Xe]()||console.error(...t),O(this,re,!0,"f"),v(this,se,"f").length&&O(this,se,v(this,se,"f")+"\n","f"),O(this,se,v(this,se,"f")+t.join(" "),"f")}}}[Se](t){p(v(this,ae,"f")).forEach((s=>{if("configObjects"===s)return;const b=v(this,ae,"f")[s];Array.isArray(b)?b.includes(t)&&b.splice(b.indexOf(t),1):"object"==typeof b&&delete b[t]})),delete v(this,ve,"f").getDescriptions()[t]}[ke](t,s,b){v(this,Y,"f")[b]||(v(this,me,"f").process.emitWarning(t,s),v(this,Y,"f")[b]=!0)}[je](){v(this,Z,"f").push({options:v(this,ae,"f"),configObjects:v(this,ae,"f").configObjects.slice(0),exitProcess:v(this,X,"f"),groups:v(this,ee,"f"),strict:v(this,De,"f"),strictCommands:v(this,ye,"f"),strictOptions:v(this,be,"f"),completionCommand:v(this,H,"f"),output:v(this,se,"f"),exitError:v(this,q,"f"),hasOutput:v(this,re,"f"),parsed:this.parsed,parseFn:v(this,le,"f"),parseContext:v(this,fe,"f")}),v(this,ve,"f").freeze(),v(this,Oe,"f").freeze(),v(this,W,"f").freeze(),v(this,Q,"f").freeze()}[Fe](){let t,s="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(v(this,me,"f").process.argv()[0])?v(this,me,"f").process.argv().slice(1,2):v(this,me,"f").process.argv().slice(0,1),s=t.map((t=>{const s=this[et](v(this,K,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&s.length<t.length?s:t})).join(" ").trim(),v(this,me,"f").getEnv("_")&&v(this,me,"f").getProcessArgvBin()===v(this,me,"f").getEnv("_")&&(s=v(this,me,"f").getEnv("_").replace(`${v(this,me,"f").path.dirname(v(this,me,"f").process.execPath())}/`,"")),s}[xe](){return v(this,ce,"f")}[_e](){return v(this,we,"f")}[Pe](){if(!v(this,J,"f"))return;const t=v(this,me,"f").getEnv("LC_ALL")||v(this,me,"f").getEnv("LC_MESSAGES")||v(this,me,"f").getEnv("LANG")||v(this,me,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[Ie](){return this[Te]().version||"unknown"}[Be](t){const s=t["--"]?t["--"]:t._;for(let t,b=0;void 0!==(t=s[b]);b++)v(this,me,"f").Parser.looksLikeNumber(t)&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))&&(s[b]=Number(t));return t}[Te](t){const s=t||"*";if(v(this,de,"f")[s])return v(this,de,"f")[s];let b={};try{let s=t||v(this,me,"f").mainFilename;!t&&v(this,me,"f").path.extname(s)&&(s=v(this,me,"f").path.dirname(s));const F=v(this,me,"f").findUp(s,((t,s)=>s.includes("package.json")?"package.json":void 0));d(F,void 0,v(this,me,"f")),b=JSON.parse(v(this,me,"f").readFileSync(F,"utf8"))}catch(t){}return v(this,de,"f")[s]=b||{},v(this,de,"f")[s]}[Me](t,s){(s=[].concat(s)).forEach((s=>{s=this[Ue](s),v(this,ae,"f")[t].push(s)}))}[Ne](t,s,b,F){this[$e](t,s,b,F,((t,s,b)=>{v(this,ae,"f")[t][s]=b}))}[Re](t,s,b,F){this[$e](t,s,b,F,((t,s,b)=>{v(this,ae,"f")[t][s]=(v(this,ae,"f")[t][s]||[]).concat(b)}))}[$e](t,s,b,F,B){if(Array.isArray(b))b.forEach((s=>{t(s,F)}));else if((t=>"object"==typeof t)(b))for(const s of p(b))t(s,b[s]);else B(s,this[Ue](b),F)}[Ue](t){return"__proto__"===t?"___proto___":t}[Le](t,s){return this[Ne](this[Le].bind(this),"key",t,s),this}[We](){var t,s,b,F,B,T,M,R,U,L,K,z;const G=v(this,Z,"f").pop();let V;d(G,void 0,v(this,me,"f")),t=this,s=this,b=this,F=this,B=this,T=this,M=this,R=this,U=this,L=this,K=this,z=this,({options:{set value(s){O(t,ae,s,"f")}}.value,configObjects:V,exitProcess:{set value(t){O(s,X,t,"f")}}.value,groups:{set value(t){O(b,ee,t,"f")}}.value,output:{set value(t){O(F,se,t,"f")}}.value,exitError:{set value(t){O(B,q,t,"f")}}.value,hasOutput:{set value(t){O(T,re,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){O(M,De,t,"f")}}.value,strictCommands:{set value(t){O(R,ye,t,"f")}}.value,strictOptions:{set value(t){O(U,be,t,"f")}}.value,completionCommand:{set value(t){O(L,H,t,"f")}}.value,parseFn:{set value(t){O(K,le,t,"f")}}.value,parseContext:{set value(t){O(z,fe,t,"f")}}.value}=G),v(this,ae,"f").configObjects=V,v(this,ve,"f").unfreeze(),v(this,Oe,"f").unfreeze(),v(this,W,"f").unfreeze(),v(this,Q,"f").unfreeze()}[Ke](t,s){return j(s,(s=>(t(s),s)))}getInternalMethods(){return{getCommandInstance:this[ze].bind(this),getContext:this[Ge].bind(this),getHasOutput:this[He].bind(this),getLoggerInstance:this[Ve].bind(this),getParseContext:this[qe].bind(this),getParserConfiguration:this[xe].bind(this),getUsageConfiguration:this[_e].bind(this),getUsageInstance:this[Je].bind(this),getValidationInstance:this[Ye].bind(this),hasParseCallback:this[Xe].bind(this),isGlobalContext:this[Ze].bind(this),postProcess:this[Qe].bind(this),reset:this[tt].bind(this),runValidation:this[nt].bind(this),runYargsParserAndExecuteCommands:this[rt].bind(this),setHasOutput:this[ot].bind(this)}}[ze](){return v(this,W,"f")}[Ge](){return v(this,z,"f")}[He](){return v(this,re,"f")}[Ve](){return v(this,ie,"f")}[qe](){return v(this,fe,"f")||{}}[Je](){return v(this,ve,"f")}[Ye](){return v(this,Oe,"f")}[Xe](){return!!v(this,le,"f")}[Ze](){return v(this,oe,"f")}[Qe](t,s,b,F){if(b)return t;if(f(t))return t;s||(t=this[Ce](t));return(this[xe]()["parse-positional-numbers"]||void 0===this[xe]()["parse-positional-numbers"])&&(t=this[Be](t)),F&&(t=C(t,this,v(this,Q,"f").getMiddleware(),!1)),t}[tt](t={}){O(this,ae,v(this,ae,"f")||{},"f");const s={};s.local=v(this,ae,"f").local||[],s.configObjects=v(this,ae,"f").configObjects||[];const b={};s.local.forEach((s=>{b[s]=!0,(t[s]||[]).forEach((t=>{b[t]=!0}))})),Object.assign(v(this,pe,"f"),Object.keys(v(this,ee,"f")).reduce(((t,s)=>{const F=v(this,ee,"f")[s].filter((t=>!(t in b)));return F.length>0&&(t[s]=F),t}),{})),O(this,ee,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{s[t]=(v(this,ae,"f")[t]||[]).filter((t=>!b[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{s[t]=g(v(this,ae,"f")[t],(t=>!b[t]))})),s.envPrefix=v(this,ae,"f").envPrefix,O(this,ae,s,"f"),O(this,ve,v(this,ve,"f")?v(this,ve,"f").reset(b):P(this,v(this,me,"f")),"f"),O(this,Oe,v(this,Oe,"f")?v(this,Oe,"f").reset(b):function(t,s,b){const F=b.y18n.__,B=b.y18n.__n,T={nonOptionCount:function(b){const F=t.getDemandedCommands(),T=b._.length+(b["--"]?b["--"].length:0)-t.getInternalMethods().getContext().commands.length;F._&&(T<F._.min||T>F._.max)&&(T<F._.min?void 0!==F._.minMsg?s.fail(F._.minMsg?F._.minMsg.replace(/\$0/g,T.toString()).replace(/\$1/,F._.min.toString()):null):s.fail(B("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",T,T.toString(),F._.min.toString())):T>F._.max&&(void 0!==F._.maxMsg?s.fail(F._.maxMsg?F._.maxMsg.replace(/\$0/g,T.toString()).replace(/\$1/,F._.max.toString()):null):s.fail(B("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",T,T.toString(),F._.max.toString()))))},positionalCount:function(t,b){b<t&&s.fail(B("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",b,b+"",t+""))},requiredArguments:function(t,b){let F=null;for(const s of Object.keys(b))Object.prototype.hasOwnProperty.call(t,s)&&void 0!==t[s]||(F=F||{},F[s]=b[s]);if(F){const t=[];for(const s of Object.keys(F)){const b=F[s];b&&t.indexOf(b)<0&&t.push(b)}const b=t.length?`\n${t.join("\n")}`:"";s.fail(B("Missing required argument: %s","Missing required arguments: %s",Object.keys(F).length,Object.keys(F).join(", ")+b))}},unknownArguments:function(b,F,M,R,U=!0){var W;const K=t.getInternalMethods().getCommandInstance().getCommands(),z=[],G=t.getInternalMethods().getContext();if(Object.keys(b).forEach((s=>{L.includes(s)||Object.prototype.hasOwnProperty.call(M,s)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),s)||T.isValidAndSomeAliasIsNotNew(s,F)||z.push(s)})),U&&(G.commands.length>0||K.length>0||R)&&b._.slice(G.commands.length).forEach((t=>{K.includes(""+t)||z.push(""+t)})),U){const s=(null===(W=t.getDemandedCommands()._)||void 0===W?void 0:W.max)||0,F=G.commands.length+s;F<b._.length&&b._.slice(F).forEach((t=>{t=String(t),G.commands.includes(t)||z.includes(t)||z.push(t)}))}z.length&&s.fail(B("Unknown argument: %s","Unknown arguments: %s",z.length,z.map((t=>t.trim()?t:`"${t}"`)).join(", ")))},unknownCommands:function(b){const F=t.getInternalMethods().getCommandInstance().getCommands(),T=[],M=t.getInternalMethods().getContext();return(M.commands.length>0||F.length>0)&&b._.slice(M.commands.length).forEach((t=>{F.includes(""+t)||T.push(""+t)})),T.length>0&&(s.fail(B("Unknown command: %s","Unknown commands: %s",T.length,T.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(s,b){if(!Object.prototype.hasOwnProperty.call(b,s))return!1;const F=t.parsed.newAliases;return[s,...b[s]].some((t=>!Object.prototype.hasOwnProperty.call(F,t)||!F[s]))},limitedChoices:function(b){const B=t.getOptions(),T={};if(!Object.keys(B.choices).length)return;Object.keys(b).forEach((t=>{-1===L.indexOf(t)&&Object.prototype.hasOwnProperty.call(B.choices,t)&&[].concat(b[t]).forEach((s=>{-1===B.choices[t].indexOf(s)&&void 0!==s&&(T[t]=(T[t]||[]).concat(s))}))}));const M=Object.keys(T);if(!M.length)return;let R=F("Invalid values:");M.forEach((t=>{R+=`\n ${F("Argument: %s, Given: %s, Choices: %s",t,s.stringifiedValues(T[t]),s.stringifiedValues(B.choices[t]))}`})),s.fail(R)}};let M={};function a(t,s){const b=Number(s);return"number"==typeof(s=isNaN(b)?s:b)?s=t._.length>=s:s.match(/^--no-.+/)?(s=s.match(/^--no-(.+)/)[1],s=!Object.prototype.hasOwnProperty.call(t,s)):s=Object.prototype.hasOwnProperty.call(t,s),s}T.implies=function(s,F){h("<string|object> [array|number|string]",[s,F],arguments.length),"object"==typeof s?Object.keys(s).forEach((t=>{T.implies(t,s[t])})):(t.global(s),M[s]||(M[s]=[]),Array.isArray(F)?F.forEach((t=>T.implies(s,t))):(d(F,void 0,b),M[s].push(F)))},T.getImplied=function(){return M},T.implications=function(t){const b=[];if(Object.keys(M).forEach((s=>{const F=s;(M[s]||[]).forEach((s=>{let B=F;const T=s;B=a(t,B),s=a(t,s),B&&!s&&b.push(` ${F} -> ${T}`)}))})),b.length){let t=`${F("Implications failed:")}\n`;b.forEach((s=>{t+=s})),s.fail(t)}};let R={};T.conflicts=function(s,b){h("<string|object> [array|string]",[s,b],arguments.length),"object"==typeof s?Object.keys(s).forEach((t=>{T.conflicts(t,s[t])})):(t.global(s),R[s]||(R[s]=[]),Array.isArray(b)?b.forEach((t=>T.conflicts(s,t))):R[s].push(b))},T.getConflicting=()=>R,T.conflicting=function(B){Object.keys(B).forEach((t=>{R[t]&&R[t].forEach((b=>{b&&void 0!==B[t]&&void 0!==B[b]&&s.fail(F("Arguments %s and %s are mutually exclusive",t,b))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(R).forEach((t=>{R[t].forEach((T=>{T&&void 0!==B[b.Parser.camelCase(t)]&&void 0!==B[b.Parser.camelCase(T)]&&s.fail(F("Arguments %s and %s are mutually exclusive",t,T))}))}))},T.recommendCommands=function(t,b){b=b.sort(((t,s)=>s.length-t.length));let B=null,T=1/0;for(let s,F=0;void 0!==(s=b[F]);F++){const b=N(t,s);b<=3&&b<T&&(T=b,B=s)}B&&s.fail(F("Did you mean %s?",B))},T.reset=function(t){return M=g(M,(s=>!t[s])),R=g(R,(s=>!t[s])),T};const U=[];return T.freeze=function(){U.push({implied:M,conflicting:R})},T.unfreeze=function(){const t=U.pop();d(t,void 0,b),({implied:M,conflicting:R}=t)},T}(this,v(this,ve,"f"),v(this,me,"f")),"f"),O(this,W,v(this,W,"f")?v(this,W,"f").reset():function(t,s,b,F){return new _(t,s,b,F)}(v(this,ve,"f"),v(this,Oe,"f"),v(this,Q,"f"),v(this,me,"f")),"f"),v(this,G,"f")||O(this,G,function(t,s,b,F){return new D(t,s,b,F)}(this,v(this,ve,"f"),v(this,W,"f"),v(this,me,"f")),"f"),v(this,Q,"f").reset(),O(this,H,null,"f"),O(this,se,"","f"),O(this,q,null,"f"),O(this,re,!1,"f"),this.parsed=!1,this}[et](t,s){return v(this,me,"f").path.relative(t,s)}[rt](t,s,b,F=0,B=!1){let T=!!b||B;t=t||v(this,he,"f"),v(this,ae,"f").__=v(this,me,"f").y18n.__,v(this,ae,"f").configuration=this[xe]();const M=!!v(this,ae,"f").configuration["populate--"],R=Object.assign({},v(this,ae,"f").configuration,{"populate--":!0}),U=v(this,me,"f").Parser.detailed(t,Object.assign({},v(this,ae,"f"),{configuration:{"parse-positional-numbers":!1,...R}})),L=Object.assign(U.argv,v(this,fe,"f"));let K;const z=U.aliases;let V=!1,q=!1;Object.keys(L).forEach((t=>{t===v(this,ne,"f")&&L[t]?V=!0:t===v(this,Ee,"f")&&L[t]&&(q=!0)})),L.$0=this.$0,this.parsed=U,0===F&&v(this,ve,"f").clearCachedHelpMessage();try{if(this[Pe](),s)return this[Qe](L,M,!!b,!1);if(v(this,ne,"f")){[v(this,ne,"f")].concat(z[v(this,ne,"f")]||[]).filter((t=>t.length>1)).includes(""+L._[L._.length-1])&&(L._.pop(),V=!0)}O(this,oe,!1,"f");const R=v(this,W,"f").getCommands(),J=v(this,G,"f").completionKey in L,Y=V||J||B;if(L._.length){if(R.length){let t;for(let s,T=F||0;void 0!==L._[T];T++){if(s=String(L._[T]),R.includes(s)&&s!==v(this,H,"f")){const t=v(this,W,"f").runCommand(s,this,U,T+1,B,V||q||B);return this[Qe](t,M,!!b,!1)}if(!t&&s!==v(this,H,"f")){t=s;break}}!v(this,W,"f").hasDefaultCommand()&&v(this,ge,"f")&&t&&!Y&&v(this,Oe,"f").recommendCommands(t,R)}v(this,H,"f")&&L._.includes(v(this,H,"f"))&&!J&&(v(this,X,"f")&&E(!0),this.showCompletionScript(),this.exit(0))}if(v(this,W,"f").hasDefaultCommand()&&!Y){const t=v(this,W,"f").runCommand(null,this,U,0,B,V||q||B);return this[Qe](t,M,!!b,!1)}if(J){v(this,X,"f")&&E(!0);const s=(t=[].concat(t)).slice(t.indexOf(`--${v(this,G,"f").completionKey}`)+1);return v(this,G,"f").getCompletion(s,((t,s)=>{if(t)throw new e(t.message);(s||[]).forEach((t=>{v(this,ie,"f").log(t)})),this.exit(0)})),this[Qe](L,!M,!!b,!1)}if(v(this,re,"f")||(V?(v(this,X,"f")&&E(!0),T=!0,this.showHelp("log"),this.exit(0)):q&&(v(this,X,"f")&&E(!0),T=!0,v(this,ve,"f").showVersion("log"),this.exit(0))),!T&&v(this,ae,"f").skipValidation.length>0&&(T=Object.keys(L).some((t=>v(this,ae,"f").skipValidation.indexOf(t)>=0&&!0===L[t]))),!T){if(U.error)throw new e(U.error.message);if(!J){const t=this[nt](z,{},U.error);b||(K=C(L,this,v(this,Q,"f").getMiddleware(),!0)),K=this[Ke](t,null!=K?K:L),f(K)&&!b&&(K=K.then((()=>C(L,this,v(this,Q,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof e))throw t;v(this,ve,"f").fail(t.message,t)}return this[Qe](null!=K?K:L,M,!!b,!0)}[nt](t,s,b,F){const B={...this.getDemandedOptions()};return T=>{if(b)throw new e(b.message);v(this,Oe,"f").nonOptionCount(T),v(this,Oe,"f").requiredArguments(T,B);let M=!1;v(this,ye,"f")&&(M=v(this,Oe,"f").unknownCommands(T)),v(this,De,"f")&&!M?v(this,Oe,"f").unknownArguments(T,t,s,!!F):v(this,be,"f")&&v(this,Oe,"f").unknownArguments(T,t,{},!1,!1),v(this,Oe,"f").limitedChoices(T),v(this,Oe,"f").implications(T),v(this,Oe,"f").conflicting(T)}}[ot](){O(this,re,!0,"f")}[it](t){if("string"==typeof t)v(this,ae,"f").key[t]=!0;else for(const s of t)v(this,ae,"f").key[s]=!0}}var st,at;const{readFileSync:ut}=b(9896),{inspect:ct}=b(9023),{resolve:lt}=b(6928),ft=b(9162),dt=b(6420);var pt,ht={assert:{notStrictEqual:F.notStrictEqual,strictEqual:F.strictEqual},cliui:b(702),findUp:b(7020),getEnv:t=>process.env[t],getCallerFile:b(9103),getProcessArgvBin:y,inspect:ct,mainFilename:null!==(at=null===(st=false||void 0===b(8501)?void 0:b.c[b.s])||void 0===st?void 0:st.filename)&&void 0!==at?at:process.cwd(),Parser:dt,path:b(6928),process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,s)=>process.emitWarning(t,s),execPath:()=>process.execPath,exit:t=>{process.exit(t)},nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:ut,require:b(8501),requireDirectory:b(763),stringWidth:b(1838),y18n:ft({directory:lt(__dirname,"../locales"),updateFiles:!1})};const gt=(null===(pt=null===process||void 0===process?void 0:process.env)||void 0===pt?void 0:pt.YARGS_MIN_NODE_VERSION)?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version){if(Number(process.version.match(/v([^.]+)/)[1])<gt)throw Error(`yargs supports a minimum Node.js version of ${gt}. Read our version support policy: https://github.com/yargs/yargs#supported-nodejs-versions`)}const mt=b(6420);var Dt,yt={applyExtends:n,cjsPlatformShim:ht,Yargs:(Dt=ht,(t=[],s=Dt.process.cwd(),b)=>{const F=new te(t,s,b,Dt);return Object.defineProperty(F,"argv",{get:()=>F.parse(),enumerable:!0}),F.help(),F.version(),F}),argsert:h,isPromise:f,objFilter:g,parseCommand:o,Parser:mt,processArgv:R,YError:e};t.exports=yt},9309:(t,s,b)=>{"use strict";b.d(s,{o0:()=>detect});var F=b(9896);var B=b(6928);var T=b(5426);async function pathExists(t){try{await F.promises.access(t);return true}catch{return false}}var M=new Map;function hasGlobalInstallation(t){const s=`has_global_${t}`;if(M.has(s)){return Promise.resolve(M.get(s))}return T(t,["--version"]).then((t=>/^\d+.\d+.\d+$/.test(t.stdout))).then((t=>{M.set(s,t);return t})).catch((()=>false))}function getTypeofLockFile(t="."){const s=`lockfile_${t}`;if(M.has(s)){return Promise.resolve(M.get(s))}return Promise.all([pathExists((0,B.resolve)(t,"yarn.lock")),pathExists((0,B.resolve)(t,"package-lock.json")),pathExists((0,B.resolve)(t,"pnpm-lock.yaml")),pathExists((0,B.resolve)(t,"bun.lockb"))]).then((([t,b,F,B])=>{let T=null;if(t){T="yarn"}else if(F){T="pnpm"}else if(B){T="bun"}else if(b){T="npm"}M.set(s,T);return T}))}var detect=async({cwd:t,includeGlobalBun:s}={})=>{const b=await getTypeofLockFile(t);if(b){return b}const[F,B,T]=await Promise.all([hasGlobalInstallation("yarn"),hasGlobalInstallation("pnpm"),s&&hasGlobalInstallation("bun")]);if(F){return"yarn"}if(B){return"pnpm"}if(T){return"bun"}return"npm"};function getNpmVersion(t){return execa(t||"npm",["--version"]).then((t=>t.stdout))}function clearCache(){return M.clear()}},222:(t,s,b)=>{"use strict";b.d(s,{A:()=>L});var F=b(2612);const{applyExtends:B,cjsPlatformShim:T,Parser:M,processArgv:R,Yargs:U}=F;U.applyExtends=(t,s,b)=>B(t,s,b,T);U.hideBin=R.hideBin;U.Parser=M;const L=U}};var s={};function __nccwpck_require__(b){var F=s[b];if(F!==undefined){return F.exports}var B=s[b]={id:b,loaded:false,exports:{}};var T=true;try{t[b](B,B.exports,__nccwpck_require__);T=false}finally{if(T)delete s[b]}B.loaded=true;return B.exports}__nccwpck_require__.c=s;(()=>{var t=typeof Symbol==="function"?Symbol("webpack queues"):"__webpack_queues__";var s=typeof Symbol==="function"?Symbol("webpack exports"):"__webpack_exports__";var b=typeof Symbol==="function"?Symbol("webpack error"):"__webpack_error__";var resolveQueue=t=>{if(t&&t.d<1){t.d=1;t.forEach((t=>t.r--));t.forEach((t=>t.r--?t.r++:t()))}};var wrapDeps=F=>F.map((F=>{if(F!==null&&typeof F==="object"){if(F[t])return F;if(F.then){var B=[];B.d=0;F.then((t=>{T[s]=t;resolveQueue(B)}),(t=>{T[b]=t;resolveQueue(B)}));var T={};T[t]=t=>t(B);return T}}var M={};M[t]=t=>{};M[s]=F;return M}));__nccwpck_require__.a=(F,B,T)=>{var M;T&&((M=[]).d=-1);var R=new Set;var U=F.exports;var L;var W;var K;var z=new Promise(((t,s)=>{K=s;W=t}));z[s]=U;z[t]=t=>(M&&t(M),R.forEach(t),z["catch"]((t=>{})));F.exports=z;B((F=>{L=wrapDeps(F);var B;var getResult=()=>L.map((t=>{if(t[b])throw t[b];return t[s]}));var T=new Promise((s=>{B=()=>s(getResult);B.r=0;var fnQueue=t=>t!==M&&!R.has(t)&&(R.add(t),t&&!t.d&&(B.r++,t.push(B)));L.map((s=>s[t](fnQueue)))}));return B.r?T:getResult()}),(t=>(t?K(z[b]=t):W(U),resolveQueue(M))));M&&M.d<0&&(M.d=0)}})();(()=>{__nccwpck_require__.n=t=>{var s=t&&t.__esModule?()=>t["default"]:()=>t;__nccwpck_require__.d(s,{a:s});return s}})();(()=>{__nccwpck_require__.d=(t,s)=>{for(var b in s){if(__nccwpck_require__.o(s,b)&&!__nccwpck_require__.o(t,b)){Object.defineProperty(t,b,{enumerable:true,get:s[b]})}}}})();(()=>{__nccwpck_require__.o=(t,s)=>Object.prototype.hasOwnProperty.call(t,s)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();(()=>{__nccwpck_require__.nmd=t=>{t.paths=[];if(!t.children)t.children=[];return t}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var b=__nccwpck_require__(__nccwpck_require__.s=1719);module.exports=b})();
|
package/package.json
CHANGED
|
@@ -1,30 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mavenagi/apps",
|
|
3
|
-
"
|
|
4
|
-
"version": "1.0.1",
|
|
3
|
+
"version": "1.0.3",
|
|
5
4
|
"description": "CLI for developing apps for Maven AGI",
|
|
6
5
|
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
6
|
"author": "Maven AGI",
|
|
9
7
|
"bin": {
|
|
10
8
|
"mavenagi": "dist/index.js"
|
|
11
9
|
},
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@types/node": "^22.10.1",
|
|
19
|
-
"typescript": "^5"
|
|
20
|
-
},
|
|
21
|
-
"nx": {
|
|
22
|
-
"targets": {
|
|
23
|
-
"build": {
|
|
24
|
-
"outputs": [
|
|
25
|
-
"{projectRoot}/dist/index.js"
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
]
|
|
13
|
+
}
|
package/dist/next.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const compiledUserWorkerEntrypointScript=`var uo=Object.create;var Ae=Object.defineProperty;var mo=Object.getOwnPropertyDescriptor;var lo=Object.getOwnPropertyNames;var ho=Object.getPrototypeOf,yo=Object.prototype.hasOwnProperty;var oe=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),go=(e,r)=>{for(var t in r)Ae(e,t,{get:r[t],enumerable:!0})},bo=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of lo(r))!yo.call(e,n)&&n!==t&&Ae(e,n,{get:()=>r[n],enumerable:!(o=mo(r,n))||o.enumerable});return e};var Eo=(e,r,t)=>(t=e!=null?uo(ho(e)):{},bo(r||!e||!e.__esModule?Ae(t,"default",{value:e,enumerable:!0}):t,e));var xr=oe((Gn,Er)=>{"use strict";var ve=Object.defineProperty,xo=Object.getOwnPropertyDescriptor,_o=Object.getOwnPropertyNames,So=Object.prototype.hasOwnProperty,Oo=(e,r)=>{for(var t in r)ve(e,t,{get:r[t],enumerable:!0})},wo=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of _o(r))!So.call(e,n)&&n!==t&&ve(e,n,{get:()=>r[n],enumerable:!(o=xo(r,n))||o.enumerable});return e},Ro=e=>wo(ve({},"__esModule",{value:!0}),e),ur={};Oo(ur,{CITY_HEADER_NAME:()=>mr,COUNTRY_HEADER_NAME:()=>Te,EMOJI_FLAG_UNICODE_STARTING_POSITION:()=>br,IP_HEADER_NAME:()=>lr,LATITUDE_HEADER_NAME:()=>dr,LONGITUDE_HEADER_NAME:()=>hr,REGION_HEADER_NAME:()=>yr,REQUEST_ID_HEADER_NAME:()=>gr,geolocation:()=>Po,ipAddress:()=>vo});Er.exports=Ro(ur);var mr="x-vercel-ip-city",Te="x-vercel-ip-country",lr="x-real-ip",dr="x-vercel-ip-latitude",hr="x-vercel-ip-longitude",yr="x-vercel-ip-country-region",gr="x-vercel-id",br=127397;function U(e,r){return e.get(r)??void 0}function Ao(e,r){let t=U(e.headers,r);return t?decodeURIComponent(t):void 0}function To(e){let r=new RegExp("^[A-Z]{2}\$").test(e);if(!(!e||!r))return String.fromCodePoint(...e.split("").map(t=>br+t.charCodeAt(0)))}function vo(e){let r="headers"in e?e.headers:e;return U(r,lr)}function Io(e){return e?e.split(":")[0]:"dev1"}function Po(e){return{city:Ao(e,mr),country:U(e.headers,Te),flag:To(U(e.headers,Te)),countryRegion:U(e.headers,yr),region:Io(U(e.headers,gr)),latitude:U(e.headers,dr),longitude:U(e.headers,hr)}}});var Or=oe((Fn,Sr)=>{"use strict";var Ie=Object.defineProperty,No=Object.getOwnPropertyDescriptor,Co=Object.getOwnPropertyNames,jo=Object.prototype.hasOwnProperty,Uo=(e,r)=>{for(var t in r)Ie(e,t,{get:r[t],enumerable:!0})},Ko=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Co(r))!jo.call(e,n)&&n!==t&&Ie(e,n,{get:()=>r[n],enumerable:!(o=No(r,n))||o.enumerable});return e},Mo=e=>Ko(Ie({},"__esModule",{value:!0}),e),_r={};Uo(_r,{getEnv:()=>zo});Sr.exports=Mo(_r);var zo=(e=process.env)=>({VERCEL:b(e,"VERCEL"),CI:b(e,"CI"),VERCEL_ENV:b(e,"VERCEL_ENV"),VERCEL_URL:b(e,"VERCEL_URL"),VERCEL_BRANCH_URL:b(e,"VERCEL_BRANCH_URL"),VERCEL_PROJECT_PRODUCTION_URL:b(e,"VERCEL_PROJECT_PRODUCTION_URL"),VERCEL_REGION:b(e,"VERCEL_REGION"),VERCEL_DEPLOYMENT_ID:b(e,"VERCEL_DEPLOYMENT_ID"),VERCEL_SKEW_PROTECTION_ENABLED:b(e,"VERCEL_SKEW_PROTECTION_ENABLED"),VERCEL_AUTOMATION_BYPASS_SECRET:b(e,"VERCEL_AUTOMATION_BYPASS_SECRET"),VERCEL_GIT_PROVIDER:b(e,"VERCEL_GIT_PROVIDER"),VERCEL_GIT_REPO_SLUG:b(e,"VERCEL_GIT_REPO_SLUG"),VERCEL_GIT_REPO_OWNER:b(e,"VERCEL_GIT_REPO_OWNER"),VERCEL_GIT_REPO_ID:b(e,"VERCEL_GIT_REPO_ID"),VERCEL_GIT_COMMIT_REF:b(e,"VERCEL_GIT_COMMIT_REF"),VERCEL_GIT_COMMIT_SHA:b(e,"VERCEL_GIT_COMMIT_SHA"),VERCEL_GIT_COMMIT_MESSAGE:b(e,"VERCEL_GIT_COMMIT_MESSAGE"),VERCEL_GIT_COMMIT_AUTHOR_LOGIN:b(e,"VERCEL_GIT_COMMIT_AUTHOR_LOGIN"),VERCEL_GIT_COMMIT_AUTHOR_NAME:b(e,"VERCEL_GIT_COMMIT_AUTHOR_NAME"),VERCEL_GIT_PREVIOUS_SHA:b(e,"VERCEL_GIT_PREVIOUS_SHA"),VERCEL_GIT_PULL_REQUEST_ID:b(e,"VERCEL_GIT_PULL_REQUEST_ID")}),b=(e,r)=>{let t=e[r];return t===""?void 0:t}});var Tr=oe((\$n,Ar)=>{"use strict";var Pe=Object.defineProperty,Do=Object.getOwnPropertyDescriptor,ko=Object.getOwnPropertyNames,Lo=Object.prototype.hasOwnProperty,Wo=(e,r)=>{for(var t in r)Pe(e,t,{get:r[t],enumerable:!0})},Vo=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of ko(r))!Lo.call(e,n)&&n!==t&&Pe(e,n,{get:()=>r[n],enumerable:!(o=Do(r,n))||o.enumerable});return e},Jo=e=>Vo(Pe({},"__esModule",{value:!0}),e),wr={};Wo(wr,{SYMBOL_FOR_REQ_CONTEXT:()=>Rr,getContext:()=>Bo});Ar.exports=Jo(wr);var Rr=Symbol.for("@vercel/request-context");function Bo(){return globalThis[Rr]?.get?.()??{}}});var Pr=oe((qn,Ir)=>{"use strict";var Ne=Object.defineProperty,Ho=Object.getOwnPropertyDescriptor,Go=Object.getOwnPropertyNames,Fo=Object.prototype.hasOwnProperty,\$o=(e,r)=>{for(var t in r)Ne(e,t,{get:r[t],enumerable:!0})},qo=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Go(r))!Fo.call(e,n)&&n!==t&&Ne(e,n,{get:()=>r[n],enumerable:!(o=Ho(r,n))||o.enumerable});return e},Yo=e=>qo(Ne({},"__esModule",{value:!0}),e),vr={};\$o(vr,{waitUntil:()=>Qo});Ir.exports=Yo(vr);var Xo=Tr(),Qo=e=>{if(e===null||typeof e!="object"||typeof e.then!="function")throw new TypeError(\`waitUntil can only be called with a Promise, got \${typeof e}\`);return(0,Xo.getContext)().waitUntil?.(e)}});var Ur=oe((Yn,jr)=>{"use strict";var Ce=Object.defineProperty,Zo=Object.getOwnPropertyDescriptor,en=Object.getOwnPropertyNames,rn=Object.prototype.hasOwnProperty,tn=(e,r)=>{for(var t in r)Ce(e,t,{get:r[t],enumerable:!0})},on=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of en(r))!rn.call(e,n)&&n!==t&&Ce(e,n,{get:()=>r[n],enumerable:!(o=Zo(r,n))||o.enumerable});return e},nn=e=>on(Ce({},"__esModule",{value:!0}),e),Cr={};tn(Cr,{geolocation:()=>Nr.geolocation,getEnv:()=>sn.getEnv,ipAddress:()=>Nr.ipAddress,waitUntil:()=>an.waitUntil});jr.exports=nn(Cr);var Nr=xr(),sn=Or(),an=Pr()});var ee=Eo(Ur());var V=crypto,ue=e=>e instanceof CryptoKey;var J=new TextEncoder,K=new TextDecoder,Qn=2**32;function Kr(...e){let r=e.reduce((n,{length:s})=>n+s,0),t=new Uint8Array(r),o=0;for(let n of e)t.set(n,o),o+=n.length;return t}var cn=e=>{let r=atob(e),t=new Uint8Array(r.length);for(let o=0;o<r.length;o++)t[o]=r.charCodeAt(o);return t},N=e=>{let r=e;r instanceof Uint8Array&&(r=K.decode(r)),r=r.replace(/-/g,"+").replace(/_/g,"/").replace(/\\s/g,"");try{return cn(r)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};var E=class extends Error{constructor(r,t){super(r,t),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};E.code="ERR_JOSE_GENERIC";var v=class extends E{constructor(r,t,o="unspecified",n="unspecified"){super(r,{cause:{claim:o,reason:n,payload:t}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=o,this.reason=n,this.payload=t}};v.code="ERR_JWT_CLAIM_VALIDATION_FAILED";var B=class extends E{constructor(r,t,o="unspecified",n="unspecified"){super(r,{cause:{claim:o,reason:n,payload:t}}),this.code="ERR_JWT_EXPIRED",this.claim=o,this.reason=n,this.payload=t}};B.code="ERR_JWT_EXPIRED";var ne=class extends E{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}};ne.code="ERR_JOSE_ALG_NOT_ALLOWED";var _=class extends E{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}};_.code="ERR_JOSE_NOT_SUPPORTED";var je=class extends E{constructor(r="decryption operation failed",t){super(r,t),this.code="ERR_JWE_DECRYPTION_FAILED"}};je.code="ERR_JWE_DECRYPTION_FAILED";var Ue=class extends E{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}};Ue.code="ERR_JWE_INVALID";var g=class extends E{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}};g.code="ERR_JWS_INVALID";var k=class extends E{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}};k.code="ERR_JWT_INVALID";var Ke=class extends E{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}};Ke.code="ERR_JWK_INVALID";var H=class extends E{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}};H.code="ERR_JWKS_INVALID";var L=class extends E{constructor(r="no applicable key found in the JSON Web Key Set",t){super(r,t),this.code="ERR_JWKS_NO_MATCHING_KEY"}};L.code="ERR_JWKS_NO_MATCHING_KEY";var ie=class extends E{constructor(r="multiple matching keys found in the JSON Web Key Set",t){super(r,t),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}};ie.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";var se=class extends E{constructor(r="request timed out",t){super(r,t),this.code="ERR_JWKS_TIMEOUT"}};se.code="ERR_JWKS_TIMEOUT";var ae=class extends E{constructor(r="signature verification failed",t){super(r,t),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}};ae.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";function C(e,r="algorithm.name"){return new TypeError(\`CryptoKey does not support this operation, its \${r} must be \${e}\`)}function me(e,r){return e.name===r}function Me(e){return parseInt(e.name.slice(4),10)}function fn(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function un(e,r){if(r.length&&!r.some(t=>e.usages.includes(t))){let t="CryptoKey does not support this operation, its usages must include ";if(r.length>2){let o=r.pop();t+=\`one of \${r.join(", ")}, or \${o}.\`}else r.length===2?t+=\`one of \${r[0]} or \${r[1]}.\`:t+=\`\${r[0]}.\`;throw new TypeError(t)}}function Mr(e,r,...t){switch(r){case"HS256":case"HS384":case"HS512":{if(!me(e.algorithm,"HMAC"))throw C("HMAC");let o=parseInt(r.slice(2),10);if(Me(e.algorithm.hash)!==o)throw C(\`SHA-\${o}\`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!me(e.algorithm,"RSASSA-PKCS1-v1_5"))throw C("RSASSA-PKCS1-v1_5");let o=parseInt(r.slice(2),10);if(Me(e.algorithm.hash)!==o)throw C(\`SHA-\${o}\`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!me(e.algorithm,"RSA-PSS"))throw C("RSA-PSS");let o=parseInt(r.slice(2),10);if(Me(e.algorithm.hash)!==o)throw C(\`SHA-\${o}\`,"algorithm.hash");break}case"EdDSA":{if(e.algorithm.name!=="Ed25519"&&e.algorithm.name!=="Ed448")throw C("Ed25519 or Ed448");break}case"ES256":case"ES384":case"ES512":{if(!me(e.algorithm,"ECDSA"))throw C("ECDSA");let o=fn(r);if(e.algorithm.namedCurve!==o)throw C(o,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}un(e,t)}function zr(e,r,...t){if(t=t.filter(Boolean),t.length>2){let o=t.pop();e+=\`one of type \${t.join(", ")}, or \${o}.\`}else t.length===2?e+=\`one of type \${t[0]} or \${t[1]}.\`:e+=\`of type \${t[0]}.\`;return r==null?e+=\` Received \${r}\`:typeof r=="function"&&r.name?e+=\` Received function \${r.name}\`:typeof r=="object"&&r!=null&&r.constructor?.name&&(e+=\` Received an instance of \${r.constructor.name}\`),e}var ze=(e,...r)=>zr("Key must be ",e,...r);function De(e,r,...t){return zr(\`Key for the \${e} algorithm must be \`,r,...t)}var ke=e=>ue(e)?!0:e?.[Symbol.toStringTag]==="KeyObject",G=["CryptoKey"];var mn=(...e)=>{let r=e.filter(Boolean);if(r.length===0||r.length===1)return!0;let t;for(let o of r){let n=Object.keys(o);if(!t||t.size===0){t=new Set(n);continue}for(let s of n){if(t.has(s))return!1;t.add(s)}}return!0},Dr=mn;function ln(e){return typeof e=="object"&&e!==null}function R(e){if(!ln(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}var kr=(e,r)=>{if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:t}=r.algorithm;if(typeof t!="number"||t<2048)throw new TypeError(\`\${e} requires key modulusLength to be 2048 bits or larger\`)}};function j(e){return R(e)&&typeof e.kty=="string"}function Lr(e){return e.kty!=="oct"&&typeof e.d=="string"}function Wr(e){return e.kty!=="oct"&&typeof e.d>"u"}function Vr(e){return j(e)&&e.kty==="oct"&&typeof e.k=="string"}function hn(e){let r,t;switch(e.kty){case"RSA":{switch(e.alg){case"PS256":case"PS384":case"PS512":r={name:"RSA-PSS",hash:\`SHA-\${e.alg.slice(-3)}\`},t=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":r={name:"RSASSA-PKCS1-v1_5",hash:\`SHA-\${e.alg.slice(-3)}\`},t=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":r={name:"RSA-OAEP",hash:\`SHA-\${parseInt(e.alg.slice(-3),10)||1}\`},t=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new _('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(e.alg){case"ES256":r={name:"ECDSA",namedCurve:"P-256"},t=e.d?["sign"]:["verify"];break;case"ES384":r={name:"ECDSA",namedCurve:"P-384"},t=e.d?["sign"]:["verify"];break;case"ES512":r={name:"ECDSA",namedCurve:"P-521"},t=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":r={name:"ECDH",namedCurve:e.crv},t=e.d?["deriveBits"]:[];break;default:throw new _('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(e.alg){case"EdDSA":r={name:e.crv},t=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":r={name:e.crv},t=e.d?["deriveBits"]:[];break;default:throw new _('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new _('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:r,keyUsages:t}}var yn=async e=>{if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:r,keyUsages:t}=hn(e),o=[r,e.ext??!1,e.key_ops??t],n={...e};return delete n.alg,delete n.use,V.subtle.importKey("jwk",n,...o)},le=yn;var Jr=e=>N(e),F,\$,Br=e=>e?.[Symbol.toStringTag]==="KeyObject",de=async(e,r,t,o,n=!1)=>{let s=e.get(r);if(s?.[o])return s[o];let c=await le({...t,alg:o});return n&&Object.freeze(r),s?s[o]=c:e.set(r,{[o]:c}),c},gn=(e,r)=>{if(Br(e)){let t=e.export({format:"jwk"});return delete t.d,delete t.dp,delete t.dq,delete t.p,delete t.q,delete t.qi,t.k?Jr(t.k):(\$||(\$=new WeakMap),de(\$,e,t,r))}return j(e)?e.k?N(e.k):(\$||(\$=new WeakMap),de(\$,e,e,r,!0)):e},bn=(e,r)=>{if(Br(e)){let t=e.export({format:"jwk"});return t.k?Jr(t.k):(F||(F=new WeakMap),de(F,e,t,r))}return j(e)?e.k?N(e.k):(F||(F=new WeakMap),de(F,e,e,r,!0)):e},Le={normalizePublicKey:gn,normalizePrivateKey:bn};async function he(e,r){if(!R(e))throw new TypeError("JWK must be an object");switch(r||(r=e.alg),e.kty){case"oct":if(typeof e.k!="string"||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return N(e.k);case"RSA":if(e.oth!==void 0)throw new _('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return le({...e,alg:r});default:throw new _('Unsupported "kty" (Key Type) Parameter value')}}var q=e=>e?.[Symbol.toStringTag],We=(e,r,t)=>{if(r.use!==void 0&&r.use!=="sig")throw new TypeError("Invalid key for this operation, when present its use must be sig");if(r.key_ops!==void 0&&r.key_ops.includes?.(t)!==!0)throw new TypeError(\`Invalid key for this operation, when present its key_ops must include \${t}\`);if(r.alg!==void 0&&r.alg!==e)throw new TypeError(\`Invalid key for this operation, when present its alg must be \${e}\`);return!0},En=(e,r,t,o)=>{if(!(r instanceof Uint8Array)){if(o&&j(r)){if(Vr(r)&&We(e,r,t))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!ke(r))throw new TypeError(De(e,r,...G,"Uint8Array",o?"JSON Web Key":null));if(r.type!=="secret")throw new TypeError(\`\${q(r)} instances for symmetric algorithms must be of type "secret"\`)}},xn=(e,r,t,o)=>{if(o&&j(r))switch(t){case"sign":if(Lr(r)&&We(e,r,t))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(Wr(r)&&We(e,r,t))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!ke(r))throw new TypeError(De(e,r,...G,o?"JSON Web Key":null));if(r.type==="secret")throw new TypeError(\`\${q(r)} instances for asymmetric algorithms must not be of type "secret"\`);if(t==="sign"&&r.type==="public")throw new TypeError(\`\${q(r)} instances for asymmetric algorithm signing must be of type "private"\`);if(t==="decrypt"&&r.type==="public")throw new TypeError(\`\${q(r)} instances for asymmetric algorithm decryption must be of type "private"\`);if(r.algorithm&&t==="verify"&&r.type==="private")throw new TypeError(\`\${q(r)} instances for asymmetric algorithm verifying must be of type "public"\`);if(r.algorithm&&t==="encrypt"&&r.type==="private")throw new TypeError(\`\${q(r)} instances for asymmetric algorithm encryption must be of type "public"\`)};function Hr(e,r,t,o){r.startsWith("HS")||r==="dir"||r.startsWith("PBES2")||/^A\\d{3}(?:GCM)?KW\$/.test(r)?En(r,t,o,e):xn(r,t,o,e)}var wi=Hr.bind(void 0,!1),Ve=Hr.bind(void 0,!0);function _n(e,r,t,o,n){if(n.crit!==void 0&&o?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||o.crit===void 0)return new Set;if(!Array.isArray(o.crit)||o.crit.length===0||o.crit.some(c=>typeof c!="string"||c.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s;t!==void 0?s=new Map([...Object.entries(t),...r.entries()]):s=r;for(let c of o.crit){if(!s.has(c))throw new _(\`Extension Header Parameter "\${c}" is not recognized\`);if(n[c]===void 0)throw new e(\`Extension Header Parameter "\${c}" is missing\`);if(s.get(c)&&o[c]===void 0)throw new e(\`Extension Header Parameter "\${c}" MUST be integrity protected\`)}return new Set(o.crit)}var Gr=_n;var Sn=(e,r)=>{if(r!==void 0&&(!Array.isArray(r)||r.some(t=>typeof t!="string")))throw new TypeError(\`"\${e}" option must be an array of strings\`);if(r)return new Set(r)},Fr=Sn;function Je(e,r){let t=\`SHA-\${e.slice(-3)}\`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:t,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:t,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:t,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:t,name:"ECDSA",namedCurve:r.namedCurve};case"EdDSA":return{name:r.name};default:throw new _(\`alg \${e} is not supported either by JOSE or your javascript runtime\`)}}async function Be(e,r,t){if(t==="sign"&&(r=await Le.normalizePrivateKey(r,e)),t==="verify"&&(r=await Le.normalizePublicKey(r,e)),ue(r))return Mr(r,e,t),r;if(r instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(ze(r,...G));return V.subtle.importKey("raw",r,{hash:\`SHA-\${e.slice(-3)}\`,name:"HMAC"},!1,[t])}throw new TypeError(ze(r,...G,"Uint8Array","JSON Web Key"))}var On=async(e,r,t,o)=>{let n=await Be(e,r,"verify");kr(e,n);let s=Je(e,n.algorithm);try{return await V.subtle.verify(s,n,t,o)}catch{return!1}},\$r=On;async function qr(e,r,t){if(!R(e))throw new g("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new g('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new g("JWS Protected Header incorrect type");if(e.payload===void 0)throw new g("JWS Payload missing");if(typeof e.signature!="string")throw new g("JWS Signature missing or incorrect type");if(e.header!==void 0&&!R(e.header))throw new g("JWS Unprotected Header incorrect type");let o={};if(e.protected)try{let Re=N(e.protected);o=JSON.parse(K.decode(Re))}catch{throw new g("JWS Protected Header is invalid")}if(!Dr(o,e.header))throw new g("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...o,...e.header},s=Gr(g,new Map([["b64",!0]]),t?.crit,o,n),c=!0;if(s.has("b64")&&(c=o.b64,typeof c!="boolean"))throw new g('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:a}=n;if(typeof a!="string"||!a)throw new g('JWS "alg" (Algorithm) Header Parameter missing or invalid');let f=t&&Fr("algorithms",t.algorithms);if(f&&!f.has(a))throw new ne('"alg" (Algorithm) Header Parameter value not allowed');if(c){if(typeof e.payload!="string")throw new g("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new g("JWS Payload must be a string or an Uint8Array instance");let p=!1;typeof r=="function"?(r=await r(o,e),p=!0,Ve(a,r,"verify"),j(r)&&(r=await he(r,a))):Ve(a,r,"verify");let m=Kr(J.encode(e.protected??""),J.encode("."),typeof e.payload=="string"?J.encode(e.payload):e.payload),y;try{y=N(e.signature)}catch{throw new g("Failed to base64url decode the signature")}if(!await \$r(a,r,y,m))throw new ae;let T;if(c)try{T=N(e.payload)}catch{throw new g("Failed to base64url decode the payload")}else typeof e.payload=="string"?T=J.encode(e.payload):T=e.payload;let w={payload:T};return e.protected!==void 0&&(w.protectedHeader=o),e.header!==void 0&&(w.unprotectedHeader=e.header),p?{...w,key:r}:w}async function Yr(e,r,t){if(e instanceof Uint8Array&&(e=K.decode(e)),typeof e!="string")throw new g("Compact JWS must be a string or Uint8Array");let{0:o,1:n,2:s,length:c}=e.split(".");if(c!==3)throw new g("Invalid Compact JWS");let a=await qr({payload:n,protected:o,signature:s},r,t),f={payload:a.payload,protectedHeader:a.protectedHeader};return typeof r=="function"?{...f,key:a.key}:f}var Xr=e=>Math.floor(e.getTime()/1e3);var wn=/^(\\+|\\-)? ?(\\d+|\\d+\\.\\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?\$/i,He=e=>{let r=wn.exec(e);if(!r||r[4]&&r[1])throw new TypeError("Invalid time period format");let t=parseFloat(r[2]),o=r[3].toLowerCase(),n;switch(o){case"sec":case"secs":case"second":case"seconds":case"s":n=Math.round(t);break;case"minute":case"minutes":case"min":case"mins":case"m":n=Math.round(t*60);break;case"hour":case"hours":case"hr":case"hrs":case"h":n=Math.round(t*3600);break;case"day":case"days":case"d":n=Math.round(t*86400);break;case"week":case"weeks":case"w":n=Math.round(t*604800);break;default:n=Math.round(t*31557600);break}return r[1]==="-"||r[4]==="ago"?-n:n};var Qr=e=>e.toLowerCase().replace(/^application\\//,""),Rn=(e,r)=>typeof e=="string"?r.includes(e):Array.isArray(e)?r.some(Set.prototype.has.bind(new Set(e))):!1,Zr=(e,r,t={})=>{let o;try{o=JSON.parse(K.decode(r))}catch{}if(!R(o))throw new k("JWT Claims Set must be a top-level JSON object");let{typ:n}=t;if(n&&(typeof e.typ!="string"||Qr(e.typ)!==Qr(n)))throw new v('unexpected "typ" JWT header value',o,"typ","check_failed");let{requiredClaims:s=[],issuer:c,subject:a,audience:f,maxTokenAge:p}=t,m=[...s];p!==void 0&&m.push("iat"),f!==void 0&&m.push("aud"),a!==void 0&&m.push("sub"),c!==void 0&&m.push("iss");for(let w of new Set(m.reverse()))if(!(w in o))throw new v(\`missing required "\${w}" claim\`,o,w,"missing");if(c&&!(Array.isArray(c)?c:[c]).includes(o.iss))throw new v('unexpected "iss" claim value',o,"iss","check_failed");if(a&&o.sub!==a)throw new v('unexpected "sub" claim value',o,"sub","check_failed");if(f&&!Rn(o.aud,typeof f=="string"?[f]:f))throw new v('unexpected "aud" claim value',o,"aud","check_failed");let y;switch(typeof t.clockTolerance){case"string":y=He(t.clockTolerance);break;case"number":y=t.clockTolerance;break;case"undefined":y=0;break;default:throw new TypeError("Invalid clockTolerance option type")}let{currentDate:S}=t,T=Xr(S||new Date);if((o.iat!==void 0||p)&&typeof o.iat!="number")throw new v('"iat" claim must be a number',o,"iat","invalid");if(o.nbf!==void 0){if(typeof o.nbf!="number")throw new v('"nbf" claim must be a number',o,"nbf","invalid");if(o.nbf>T+y)throw new v('"nbf" claim timestamp check failed',o,"nbf","check_failed")}if(o.exp!==void 0){if(typeof o.exp!="number")throw new v('"exp" claim must be a number',o,"exp","invalid");if(o.exp<=T-y)throw new B('"exp" claim timestamp check failed',o,"exp","check_failed")}if(p){let w=T-o.iat,Re=typeof p=="number"?p:He(p);if(w-y>Re)throw new B('"iat" claim timestamp check failed (too far in the past)',o,"iat","check_failed");if(w<0-y)throw new v('"iat" claim timestamp check failed (it should be in the past)',o,"iat","check_failed")}return o};async function Ge(e,r,t){let o=await Yr(e,r,t);if(o.protectedHeader.crit?.includes("b64")&&o.protectedHeader.b64===!1)throw new k("JWTs MUST NOT use unencoded payload");let s={payload:Zr(o.protectedHeader,o.payload,t),protectedHeader:o.protectedHeader};return typeof r=="function"?{...s,key:o.key}:s}function An(e){switch(typeof e=="string"&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new _('Unsupported "alg" value for a JSON Web Key Set')}}function Tn(e){return e&&typeof e=="object"&&Array.isArray(e.keys)&&e.keys.every(vn)}function vn(e){return R(e)}function rt(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}var Fe=class{constructor(r){if(this._cached=new WeakMap,!Tn(r))throw new H("JSON Web Key Set malformed");this._jwks=rt(r)}async getKey(r,t){let{alg:o,kid:n}={...r,...t?.header},s=An(o),c=this._jwks.keys.filter(p=>{let m=s===p.kty;if(m&&typeof n=="string"&&(m=n===p.kid),m&&typeof p.alg=="string"&&(m=o===p.alg),m&&typeof p.use=="string"&&(m=p.use==="sig"),m&&Array.isArray(p.key_ops)&&(m=p.key_ops.includes("verify")),m&&o==="EdDSA"&&(m=p.crv==="Ed25519"||p.crv==="Ed448"),m)switch(o){case"ES256":m=p.crv==="P-256";break;case"ES256K":m=p.crv==="secp256k1";break;case"ES384":m=p.crv==="P-384";break;case"ES512":m=p.crv==="P-521";break}return m}),{0:a,length:f}=c;if(f===0)throw new L;if(f!==1){let p=new ie,{_cached:m}=this;throw p[Symbol.asyncIterator]=async function*(){for(let y of c)try{yield await et(m,y,o)}catch{}},p}return et(this._cached,a,o)}};async function et(e,r,t){let o=e.get(r)||e.set(r,{}).get(r);if(o[t]===void 0){let n=await he({...r,ext:!0},t);if(n instanceof Uint8Array||n.type!=="public")throw new H("JSON Web Key Set members must be public keys");o[t]=n}return o[t]}function \$e(e){let r=new Fe(e),t=async(o,n)=>r.getKey(o,n);return Object.defineProperties(t,{jwks:{value:()=>rt(r._jwks),enumerable:!0,configurable:!1,writable:!1}}),t}var In=async(e,r,t)=>{let o,n,s=!1;typeof AbortController=="function"&&(o=new AbortController,n=setTimeout(()=>{s=!0,o.abort()},r));let c=await fetch(e.href,{signal:o?o.signal:void 0,redirect:"manual",headers:t.headers}).catch(a=>{throw s?new se:a});if(n!==void 0&&clearTimeout(n),c.status!==200)throw new E("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await c.json()}catch{throw new E("Failed to parse the JSON Web Key Set HTTP response as JSON")}},tt=In;function Pn(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}var qe;(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(qe="jose/v5.9.6");var ye=Symbol();function Nn(e,r){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=r||!("jwks"in e)||!R(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,R))}var Ye=class{constructor(r,t){if(!(r instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(r.href),this._options={agent:t?.agent,headers:t?.headers},this._timeoutDuration=typeof t?.timeoutDuration=="number"?t?.timeoutDuration:5e3,this._cooldownDuration=typeof t?.cooldownDuration=="number"?t?.cooldownDuration:3e4,this._cacheMaxAge=typeof t?.cacheMaxAge=="number"?t?.cacheMaxAge:6e5,t?.[ye]!==void 0&&(this._cache=t?.[ye],Nn(t?.[ye],this._cacheMaxAge)&&(this._jwksTimestamp=this._cache.uat,this._local=\$e(this._cache.jwks)))}coolingDown(){return typeof this._jwksTimestamp=="number"?Date.now()<this._jwksTimestamp+this._cooldownDuration:!1}fresh(){return typeof this._jwksTimestamp=="number"?Date.now()<this._jwksTimestamp+this._cacheMaxAge:!1}async getKey(r,t){(!this._local||!this.fresh())&&await this.reload();try{return await this._local(r,t)}catch(o){if(o instanceof L&&this.coolingDown()===!1)return await this.reload(),this._local(r,t);throw o}}async reload(){this._pendingFetch&&Pn()&&(this._pendingFetch=void 0);let r=new Headers(this._options.headers);qe&&!r.has("User-Agent")&&(r.set("User-Agent",qe),this._options.headers=Object.fromEntries(r.entries())),this._pendingFetch||(this._pendingFetch=tt(this._url,this._timeoutDuration,this._options).then(t=>{this._local=\$e(t),this._cache&&(this._cache.uat=Date.now(),this._cache.jwks=t),this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(t=>{throw this._pendingFetch=void 0,t})),await this._pendingFetch}};function Xe(e,r){let t=new Ye(e,r),o=async(n,s)=>t.getKey(n,s);return Object.defineProperties(o,{coolingDown:{get:()=>t.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>t.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>t.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>!!t._pendingFetch,enumerable:!0,configurable:!1},jwks:{value:()=>t._local?.jwks(),enumerable:!0,configurable:!1,writable:!1}}),o}var Qe,Ze,er,rr,tr,Cn=typeof window<"u"&&typeof window.document<"u",jn=typeof self=="object"&&typeof self?.importScripts=="function"&&(((Qe=self.constructor)===null||Qe===void 0?void 0:Qe.name)==="DedicatedWorkerGlobalScope"||((Ze=self.constructor)===null||Ze===void 0?void 0:Ze.name)==="ServiceWorkerGlobalScope"||((er=self.constructor)===null||er===void 0?void 0:er.name)==="SharedWorkerGlobalScope"),ot=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",nt=typeof Bun<"u"&&typeof Bun.version<"u",Un=typeof process<"u"&&!!process.version&&!!(!((rr=process.versions)===null||rr===void 0)&&rr.node)&&!ot&&!nt,Kn=typeof navigator<"u"&&navigator?.product==="ReactNative",Mn=typeof globalThis<"u"&&((tr=globalThis?.navigator)===null||tr===void 0?void 0:tr.userAgent)==="Cloudflare-Workers",or=zn();function zn(){return Cn?{type:"browser",version:window.navigator.userAgent}:Mn?{type:"workerd"}:jn?{type:"web-worker"}:ot?{type:"deno",version:Deno.version.deno}:nt?{type:"bun",version:Bun.version}:Un?{type:"node",version:process.versions.node,parsedVersion:Number(process.versions.node.split(".")[0])}:Kn?{type:"react-native"}:{type:"unknown"}}var i={};go(i,{JsonError:()=>Y,ParseError:()=>X,any:()=>Et,bigint:()=>st,boolean:()=>xt,booleanLiteral:()=>bt,date:()=>at,discriminant:()=>It,enum_:()=>be,getObjectLikeUtils:()=>P,getObjectUtils:()=>W,getSchemaUtils:()=>h,isProperty:()=>z,lazy:()=>ct,lazyObject:()=>ht,list:()=>xe,number:()=>_t,object:()=>Ee,objectWithoutOptionalProperties:()=>dt,optional:()=>nr,property:()=>ft,record:()=>Rt,set:()=>At,string:()=>St,stringLiteral:()=>gt,transform:()=>ir,undiscriminatedUnion:()=>vt,union:()=>Nt,unknown:()=>Ot,withParsedProperties:()=>ar});var l={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",OPTIONAL:"optional"};function d(e,r){return\`Expected \${r}. Received \${Dn(e)}.\`}function Dn(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return\`"\${e}"\`;case"bigint":case"number":case"boolean":case"undefined":return\`\${e}\`}return typeof e}function x(e){return Object.assign(Object.assign({},e),{json:it(e.json),parse:it(e.parse)})}function it(e){return(r,t)=>{let o=e(r,t),{skipValidation:n=!1}=t??{};return!o.ok&&n?(console.warn(["Failed to validate.",...o.errors.map(s=>" - "+(s.path.length>0?\`\${s.path.join(".")}: \${s.message}\`:s.message))].join(\`\n\`)),{ok:!0,value:r}):o}}function ge(e){return e.path.length===0?e.message:\`\${e.path.join(" -> ")}: \${e.message}\`}var Y=class e extends Error{constructor(r){super(r.map(ge).join("; ")),this.errors=r,Object.setPrototypeOf(this,e.prototype)}};var X=class e extends Error{constructor(r){super(r.map(ge).join("; ")),this.errors=r,Object.setPrototypeOf(this,e.prototype)}};function h(e){return{optional:()=>nr(e),transform:r=>ir(e,r),parseOrThrow:(r,t)=>{let o=e.parse(r,t);if(o.ok)return o.value;throw new X(o.errors)},jsonOrThrow:(r,t)=>{let o=e.json(r,t);if(o.ok)return o.value;throw new Y(o.errors)}}}function nr(e){let r={parse:(t,o)=>t==null?{ok:!0,value:void 0}:e.parse(t,o),json:(t,o)=>o?.omitUndefined&&t===void 0?{ok:!0,value:void 0}:t==null?{ok:!0,value:null}:e.json(t,o),getType:()=>l.OPTIONAL};return Object.assign(Object.assign({},r),h(r))}function ir(e,r){let t={parse:(o,n)=>{let s=e.parse(o,n);return s.ok?{ok:!0,value:r.transform(s.value)}:s},json:(o,n)=>{let s=r.untransform(o);return e.json(s,n)},getType:()=>e.getType()};return Object.assign(Object.assign({},t),h(t))}function st(){let e={parse:(r,{breadcrumbsPrefix:t=[]}={})=>typeof r!="string"?{ok:!1,errors:[{path:t,message:d(r,"string")}]}:{ok:!0,value:BigInt(r)},json:(r,{breadcrumbsPrefix:t=[]}={})=>typeof r=="bigint"?{ok:!0,value:r.toString()}:{ok:!1,errors:[{path:t,message:d(r,"bigint")}]},getType:()=>l.BIGINT};return Object.assign(Object.assign({},x(e)),h(e))}var kn=/^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?\$/;function at(){let e={parse:(r,{breadcrumbsPrefix:t=[]}={})=>typeof r!="string"?{ok:!1,errors:[{path:t,message:d(r,"string")}]}:kn.test(r)?{ok:!0,value:new Date(r)}:{ok:!1,errors:[{path:t,message:d(r,"ISO 8601 date string")}]},json:(r,{breadcrumbsPrefix:t=[]}={})=>r instanceof Date?{ok:!0,value:r.toISOString()}:{ok:!1,errors:[{path:t,message:d(r,"Date object")}]},getType:()=>l.DATE};return Object.assign(Object.assign({},x(e)),h(e))}function O(e,r){return()=>{let t={parse:r,json:r,getType:()=>e};return Object.assign(Object.assign({},x(t)),h(t))}}function be(e){let r=new Set(e);return O(l.ENUM,(o,{allowUnrecognizedEnumValues:n,breadcrumbsPrefix:s=[]}={})=>typeof o!="string"?{ok:!1,errors:[{path:s,message:d(o,"string")}]}:!r.has(o)&&!n?{ok:!1,errors:[{path:s,message:d(o,"enum")}]}:{ok:!0,value:o})()}function ct(e){let r=sr(e);return Object.assign(Object.assign({},r),h(r))}function sr(e){return{parse:(r,t)=>Q(e).parse(r,t),json:(r,t)=>Q(e).json(r,t),getType:()=>Q(e).getType()}}function Q(e){let r=e;return r.__zurg_memoized==null&&(r.__zurg_memoized=e()),r.__zurg_memoized}function ce(e){return Object.entries(e)}function pe(e,r){let t=new Set(r);return Object.entries(e).reduce((o,[n,s])=>(t.has(n)&&(o[n]=s),o),{})}function M(e){if(typeof e!="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function fe(e){return Object.keys(e)}function pt(e,r){let t=[],o=[];for(let n of e)r(n)?t.push(n):o.push(n);return[t,o]}function P(e){return{withParsedProperties:r=>ar(e,r)}}function ar(e,r){let t={parse:(o,n)=>{let s=e.parse(o,n);if(!s.ok)return s;let c=Object.entries(r).reduce((a,[f,p])=>Object.assign(Object.assign({},a),{[f]:typeof p=="function"?p(s.value):p}),{});return{ok:!0,value:Object.assign(Object.assign({},s.value),c)}},json:(o,n)=>{var s;if(!M(o))return{ok:!1,errors:[{path:(s=n?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],message:d(o,"object")}]};let c=new Set(Object.keys(r)),a=pe(o,Object.keys(o).filter(f=>!c.has(f)));return e.json(a,n)},getType:()=>e.getType()};return Object.assign(Object.assign(Object.assign({},t),h(t)),P(t))}function ft(e,r){return{rawKey:e,valueSchema:r,isProperty:!0}}function z(e){return e.isProperty}function Ee(e){let r={_getRawProperties:()=>Object.entries(e).map(([t,o])=>z(o)?o.rawKey:t),_getParsedProperties:()=>fe(e),parse:(t,o)=>{let n={},s=[];for(let[c,a]of ce(e)){let f=z(a)?a.rawKey:c,p=z(a)?a.valueSchema:a,m={rawKey:f,parsedKey:c,valueSchema:p};n[f]=m,lt(p)&&s.push(f)}return ut({value:t,requiredKeys:s,getProperty:c=>{let a=n[c];if(a!=null)return{transformedKey:a.parsedKey,transform:f=>{var p;return a.valueSchema.parse(f,Object.assign(Object.assign({},o),{breadcrumbsPrefix:[...(p=o?.breadcrumbsPrefix)!==null&&p!==void 0?p:[],c]}))}}},unrecognizedObjectKeys:o?.unrecognizedObjectKeys,skipValidation:o?.skipValidation,breadcrumbsPrefix:o?.breadcrumbsPrefix,omitUndefined:o?.omitUndefined})},json:(t,o)=>{let n=[];for(let[s,c]of ce(e)){let a=z(c)?c.valueSchema:c;lt(a)&&n.push(s)}return ut({value:t,requiredKeys:n,getProperty:s=>{let c=e[s];if(c!=null)return z(c)?{transformedKey:c.rawKey,transform:a=>{var f;return c.valueSchema.json(a,Object.assign(Object.assign({},o),{breadcrumbsPrefix:[...(f=o?.breadcrumbsPrefix)!==null&&f!==void 0?f:[],s]}))}}:{transformedKey:s,transform:a=>{var f;return c.json(a,Object.assign(Object.assign({},o),{breadcrumbsPrefix:[...(f=o?.breadcrumbsPrefix)!==null&&f!==void 0?f:[],s]}))}}},unrecognizedObjectKeys:o?.unrecognizedObjectKeys,skipValidation:o?.skipValidation,breadcrumbsPrefix:o?.breadcrumbsPrefix,omitUndefined:o?.omitUndefined})},getType:()=>l.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},x(r)),h(r)),P(r)),W(r))}function ut({value:e,requiredKeys:r,getProperty:t,unrecognizedObjectKeys:o="fail",skipValidation:n=!1,breadcrumbsPrefix:s=[]}){if(!M(e))return{ok:!1,errors:[{path:s,message:d(e,"object")}]};let c=new Set(r),a=[],f={};for(let[p,m]of Object.entries(e)){let y=t(p);if(y!=null){c.delete(p);let S=y.transform(m);S.ok?f[y.transformedKey]=S.value:(f[p]=m,a.push(...S.errors))}else switch(o){case"fail":a.push({path:[...s,p],message:\`Unexpected key "\${p}"\`});break;case"strip":break;case"passthrough":f[p]=m;break}}return a.push(...r.filter(p=>c.has(p)).map(p=>({path:s,message:\`Missing required key "\${p}"\`}))),a.length===0||n?{ok:!0,value:f}:{ok:!1,errors:a}}function W(e){return{extend:r=>{let t={_getParsedProperties:()=>[...e._getParsedProperties(),...r._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...r._getRawProperties()],parse:(o,n)=>mt({extensionKeys:r._getRawProperties(),value:o,transformBase:s=>e.parse(s,n),transformExtension:s=>r.parse(s,n)}),json:(o,n)=>mt({extensionKeys:r._getParsedProperties(),value:o,transformBase:s=>e.json(s,n),transformExtension:s=>r.json(s,n)}),getType:()=>l.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},t),h(t)),P(t)),W(t))},passthrough:()=>{let r={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(t,o)=>{let n=e.parse(t,Object.assign(Object.assign({},o),{unrecognizedObjectKeys:"passthrough"}));return n.ok?{ok:!0,value:Object.assign(Object.assign({},t),n.value)}:n},json:(t,o)=>{let n=e.json(t,Object.assign(Object.assign({},o),{unrecognizedObjectKeys:"passthrough"}));return n.ok?{ok:!0,value:Object.assign(Object.assign({},t),n.value)}:n},getType:()=>l.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},r),h(r)),P(r)),W(r))}}}function mt({extensionKeys:e,value:r,transformBase:t,transformExtension:o}){let n=new Set(e),[s,c]=pt(fe(r),p=>n.has(p)),a=t(pe(r,c)),f=o(pe(r,s));return a.ok&&f.ok?{ok:!0,value:Object.assign(Object.assign({},a.value),f.value)}:{ok:!1,errors:[...a.ok?[]:a.errors,...f.ok?[]:f.errors]}}function lt(e){return!Ln(e)}function Ln(e){switch(e.getType()){case l.ANY:case l.UNKNOWN:case l.OPTIONAL:return!0;default:return!1}}function dt(e){return Ee(e)}function ht(e){let r=Object.assign(Object.assign({},sr(e)),{_getRawProperties:()=>Q(e)._getRawProperties(),_getParsedProperties:()=>Q(e)._getParsedProperties()});return Object.assign(Object.assign(Object.assign(Object.assign({},r),h(r)),P(r)),W(r))}function xe(e){let r={parse:(t,o)=>yt(t,(n,s)=>{var c;return e.parse(n,Object.assign(Object.assign({},o),{breadcrumbsPrefix:[...(c=o?.breadcrumbsPrefix)!==null&&c!==void 0?c:[],\`[\${s}]\`]}))}),json:(t,o)=>yt(t,(n,s)=>{var c;return e.json(n,Object.assign(Object.assign({},o),{breadcrumbsPrefix:[...(c=o?.breadcrumbsPrefix)!==null&&c!==void 0?c:[],\`[\${s}]\`]}))}),getType:()=>l.LIST};return Object.assign(Object.assign({},x(r)),h(r))}function yt(e,r){return Array.isArray(e)?e.map((o,n)=>r(o,n)).reduce((o,n)=>{if(o.ok&&n.ok)return{ok:!0,value:[...o.value,n.value]};let s=[];return o.ok||s.push(...o.errors),n.ok||s.push(...n.errors),{ok:!1,errors:s}},{ok:!0,value:[]}):{ok:!1,errors:[{message:d(e,"list"),path:[]}]}}function gt(e){return O(l.STRING_LITERAL,(t,{breadcrumbsPrefix:o=[]}={})=>t===e?{ok:!0,value:e}:{ok:!1,errors:[{path:o,message:d(t,\`"\${e}"\`)}]})()}function bt(e){return O(l.BOOLEAN_LITERAL,(t,{breadcrumbsPrefix:o=[]}={})=>t===e?{ok:!0,value:e}:{ok:!1,errors:[{path:o,message:d(t,\`\${e.toString()}\`)}]})()}var Et=O(l.ANY,e=>({ok:!0,value:e}));var xt=O(l.BOOLEAN,(e,{breadcrumbsPrefix:r=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:r,message:d(e,"boolean")}]});var _t=O(l.NUMBER,(e,{breadcrumbsPrefix:r=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:r,message:d(e,"number")}]});var St=O(l.STRING,(e,{breadcrumbsPrefix:r=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:r,message:d(e,"string")}]});var Ot=O(l.UNKNOWN,e=>({ok:!0,value:e}));function Rt(e,r){let t={parse:(o,n)=>wt({value:o,isKeyNumeric:e.getType()===l.NUMBER,transformKey:s=>{var c;return e.parse(s,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(c=n?.breadcrumbsPrefix)!==null&&c!==void 0?c:[],\`\${s} (key)\`]}))},transformValue:(s,c)=>{var a;return r.parse(s,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(a=n?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],\`\${c}\`]}))},breadcrumbsPrefix:n?.breadcrumbsPrefix}),json:(o,n)=>wt({value:o,isKeyNumeric:e.getType()===l.NUMBER,transformKey:s=>{var c;return e.json(s,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(c=n?.breadcrumbsPrefix)!==null&&c!==void 0?c:[],\`\${s} (key)\`]}))},transformValue:(s,c)=>{var a;return r.json(s,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(a=n?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],\`\${c}\`]}))},breadcrumbsPrefix:n?.breadcrumbsPrefix}),getType:()=>l.RECORD};return Object.assign(Object.assign({},x(t)),h(t))}function wt({value:e,isKeyNumeric:r,transformKey:t,transformValue:o,breadcrumbsPrefix:n=[]}){return M(e)?ce(e).reduce((s,[c,a])=>{if(a==null)return s;let f=s,p=c;if(r){let T=c.length>0?Number(c):NaN;isNaN(T)||(p=T)}let m=t(p),y=o(a,p);if(f.ok&&m.ok&&y.ok)return{ok:!0,value:Object.assign(Object.assign({},f.value),{[m.value]:y.value})};let S=[];return f.ok||S.push(...f.errors),m.ok||S.push(...m.errors),y.ok||S.push(...y.errors),{ok:!1,errors:S}},{ok:!0,value:{}}):{ok:!1,errors:[{path:n,message:d(e,"object")}]}}function At(e){let r=xe(e),t={parse:(o,n)=>{let s=r.parse(o,n);return s.ok?{ok:!0,value:new Set(s.value)}:s},json:(o,n)=>{var s;return o instanceof Set?r.json([...o],n):{ok:!1,errors:[{path:(s=n?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],message:d(o,"Set")}]}},getType:()=>l.SET};return Object.assign(Object.assign({},x(t)),h(t))}function vt(e){let r={parse:(t,o)=>Tt((n,s)=>n.parse(t,s),e,o),json:(t,o)=>Tt((n,s)=>n.json(t,s),e,o),getType:()=>l.UNDISCRIMINATED_UNION};return Object.assign(Object.assign({},x(r)),h(r))}function Tt(e,r,t){let o=[];for(let[n,s]of r.entries()){let c=e(s,Object.assign(Object.assign({},t),{skipValidation:!1}));if(c.ok)return c;for(let a of c.errors)o.push({path:a.path,message:\`[Variant \${n}] \${a.message}\`})}return{ok:!1,errors:o}}function It(e,r){return{parsedDiscriminant:e,rawDiscriminant:r}}var Wn=function(e,r){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)r.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(t[o[n]]=e[o[n]]);return t};function Nt(e,r){let t=typeof e=="string"?e:e.rawDiscriminant,o=typeof e=="string"?e:e.parsedDiscriminant,n=be(fe(r)),s={parse:(c,a)=>Pt({value:c,discriminant:t,transformedDiscriminant:o,transformDiscriminantValue:f=>{var p;return n.parse(f,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(p=a?.breadcrumbsPrefix)!==null&&p!==void 0?p:[],t]})},getAdditionalPropertiesSchema:f=>r[f],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(f,p)=>p.parse(f,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),json:(c,a)=>Pt({value:c,discriminant:o,transformedDiscriminant:t,transformDiscriminantValue:f=>{var p;return n.json(f,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(p=a?.breadcrumbsPrefix)!==null&&p!==void 0?p:[],o]})},getAdditionalPropertiesSchema:f=>r[f],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(f,p)=>p.json(f,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),getType:()=>l.UNION};return Object.assign(Object.assign(Object.assign({},x(s)),h(s)),P(s))}function Pt({value:e,discriminant:r,transformedDiscriminant:t,transformDiscriminantValue:o,getAdditionalPropertiesSchema:n,allowUnrecognizedUnionMembers:s=!1,transformAdditionalProperties:c,breadcrumbsPrefix:a=[]}){if(!M(e))return{ok:!1,errors:[{path:a,message:d(e,"object")}]};let f=e,p=r,m=f[p],y=Wn(f,[typeof p=="symbol"?p:p+""]);if(m==null)return{ok:!1,errors:[{path:a,message:\`Missing discriminant ("\${r}")\`}]};let S=o(m);if(!S.ok)return{ok:!1,errors:S.errors};let T=n(S.value);if(T==null)return s?{ok:!0,value:Object.assign({[t]:S.value},y)}:{ok:!1,errors:[{path:[...a,r],message:"Unexpected discriminant value"}]};let w=c(y,T);return w.ok?{ok:!0,value:Object.assign({[t]:m},w.value)}:w}var I=i.object({organizationId:i.string(),agentId:i.string(),settings:i.record(i.string(),i.unknown())});var Ct=i.object({}).extend(I);var jt=i.object({}).extend(I);var Ut=i.enum_(["CONVERSATION","CONVERSATION_MESSAGE","KNOWLEDGE_BASE","KNOWLEDGE_DOCUMENT","ACTION","USER","EVENT","EVENT_TRIGGER","USER_PROFILE","FEEDBACK"]);var D=i.object({referenceId:i.string()});var A=i.object({type:Ut,appId:i.string(),organizationId:i.string(),agentId:i.string()}).extend(D);var Kt=i.enum_(["THUMBS_UP","THUMBS_DOWN","INSERT","HANDOFF"]);var Mt=i.object({type:Kt,text:i.string().optional()});var zt=i.object({feedbackId:A,conversationId:A,conversationMessageId:A,userId:A.optional(),createdAt:i.date().optional()}).extend(Mt);var Dt=i.object({feedbacks:i.list(zt)}).extend(I);var kt=i.object({conversations:i.list(A)}).extend(I);var Lt=i.enum_(["EMAIL","PHONE_NUMBER"]);var _e=i.object({value:i.string(),type:Lt});var Wt=i.object({userId:D.optional(),userIdentifiers:i.list(_e),allUserData:i.record(i.string(),i.record(i.string(),i.string())),defaultUserData:i.record(i.string(),i.string())});var Vt=i.object({actionId:i.string(),conversationId:A.optional(),conversationMetadata:i.record(i.string(),i.string()),parameters:i.record(i.string(),i.unknown()),user:Wt}).extend(I);var uu=i.object({response:i.string()});var Jt=i.object({knowledgeBaseId:D}).extend(I);var Ru=i.object({message:i.string().optional()});function Bt(e){return e}var Ht=i.string().transform({transform:Bt,untransform:e=>e});var Gt=i.enum_(["text","array","color","image"]);var Ft=i.object({displayName:i.string(),description:i.string().optional(),type:Gt});var pl=i.record(Ht,Ft);var \$t=i.enum_(["VISIBLE","PARTIALLY_VISIBLE","HIDDEN"]);var qt=i.object({value:i.string(),visibility:\$t});var Se=i.object({identifiers:i.list(_e),data:i.record(i.string(),qt)});var El=i.object({userId:D}).extend(Se);var Ol=i.object({userId:A,allUserData:i.record(i.string(),i.record(i.string(),i.string())),defaultUserData:i.record(i.string(),i.string())}).extend(Se);var Yt=i.enum_(["CONVERSATION_CREATED","FEEDBACK_CREATED"]);var Xt=i.object({description:i.string(),type:Yt});var Pl=i.object({triggerId:A}).extend(Xt);var Cl=i.object({number:i.number(),size:i.number(),totalElements:i.number(),totalPages:i.number()});var Ul=i.object({page:i.number().optional(),size:i.number().optional(),sortId:i.string().optional(),sortDesc:i.boolean().optional()});var Qt=i.enum_(["STRING","BOOLEAN","NUMBER"]);var Zt=i.object({label:i.string(),value:i.unknown()});var eo=i.enum_(["POSITIVE","NEGATIVE","NEUTRAL","MIXED","UNKNOWN"]);var Ll=i.object({userRequest:i.string().optional(),agentResponse:i.string().optional(),resolutionStatus:i.string().optional(),category:i.string().optional(),sentiment:eo.optional()});var ro=i.enum_(["SHORT","MEDIUM","LONG"]);var to=i.enum_(["MARKDOWN","FORMS","IMAGES","CHARTS_HIGHCHARTS_TS"]);var Gl=i.object({capabilities:i.list(to),isCopilot:i.boolean(),responseLength:ro});var oo=i.object({id:i.string(),label:i.string(),description:i.string(),required:i.boolean(),type:Qt.optional(),enumOptions:i.list(Zt).optional()});var no=i.object({name:i.string(),description:i.string(),userInteractionRequired:i.boolean(),buttonName:i.string().optional(),precondition:i.lazy(()=>Oe).optional(),userFormParameters:i.list(oo)});var rd=i.object({actionId:A}).extend(no);var io=i.enum_(["NOT"]);var Z=i.object({operator:io.optional()});var we=i.object({key:i.string(),value:i.string().optional()}).extend(Z);var so=i.object({tags:i.set(i.string())}).extend(Z);var ao=i.object({actionId:i.string(),appId:i.string().optional()}).extend(Z);var co=i.union("conversationPreconditionType",{tags:so,metadata:we,actionExecuted:ao}).transform({transform:e=>e,untransform:e=>e});var Oe=i.union("preconditionType",{user:we,conversation:i.object({value:co}),group:i.lazyObject(()=>po)}).transform({transform:e=>e,untransform:e=>e});var fo=i.enum_(["AND","OR"]);var po=i.object({operator:fo,preconditions:i.list(i.lazy(()=>Oe))});import re from"../..";async function te(e){let t=\`https://developers\${process.env.ENVIRONMENT===void 0?"":\`.\${process.env.ENVIRONMENT==="sandbox"?\`\${process.env.SANDBOX_USER}.sb\`:process.env.ENVIRONMENT}\`}.mavenagi-apis.com/.well-known/jwks\`,o=Xe(new URL(t)),n=e.headers.get("authorization").replace("Bearer ","");await Ge(n,o,{issuer:"https://developers.mavenagi.com",audience:process.env.MAVENAGI_APP_ID})}async function xh(e){await te(e);let{organizationId:r,agentId:t,settings:o,actionId:n,conversationId:s,conversationMetadata:c,parameters:a,user:f}=Vt.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{let p=await re.executeAction?.({organizationId:r,agentId:t,settings:o,actionId:n,conversationId:s,conversationMetadata:c,parameters:a,user:f});return new Response(JSON.stringify({response:p}),{status:200,headers:{"Content-Type":"application/json"}})}catch(p){return console.error(p),p instanceof Error?new Response(p.message,{status:500}):new Response("No result returned",{status:204})}}async function _h(e){await te(e);let{organizationId:r,agentId:t,settings:o,feedbacks:n}=Dt.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await re.feedbackCreatedOrUpdated?.({organizationId:r,agentId:t,settings:o,feedbacks:n,ctx:{waitUntil:ee.waitUntil}}),new Response(null)}catch(s){return console.error(s),s instanceof Error?new Response(s.message,{status:500}):new Response("Unknown error",{status:500})}}async function Sh(e){await te(e);let{organizationId:r,agentId:t,settings:o,conversations:n}=kt.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await re.conversationCreatedOrUpdated?.({organizationId:r,agentId:t,settings:o,conversations:n,ctx:{waitUntil:ee.waitUntil}}),new Response(null)}catch(s){return console.error(s),s instanceof Error?new Response(s.message,{status:500}):new Response("Unknown error",{status:500})}}async function Oh(e){await te(e);let{organizationId:r,agentId:t,settings:o,knowledgeBaseId:n}=Jt.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await re.knowledgeBaseRefreshed?.({organizationId:r,agentId:t,knowledgeBaseId:n,settings:o,ctx:{waitUntil:ee.waitUntil}}),new Response(null)}catch(s){return console.error(s),s instanceof Error?new Response(s.message,{status:500}):new Response("Unknown error",{status:500})}}async function wh(e){await te(e);let{organizationId:r,agentId:t,settings:o}=jt.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await re.postInstall?.({organizationId:r,agentId:t,settings:o,ctx:{waitUntil:ee.waitUntil}}),new Response(null)}catch(n){return console.error(n),n instanceof Error?new Response(n.message,{status:400}):new Response("Unknown error",{status:500})}}async function Rh(e){await te(e);let{organizationId:r,agentId:t,settings:o}=Ct.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await re.preInstall?.({organizationId:r,agentId:t,settings:o,ctx:{waitUntil:ee.waitUntil}}),new Response(null)}catch(n){return console.error(n),n instanceof Error?new Response(n.message,{status:400}):new Response("Unknown error",{status:500})}}export{Sh as conversationCreatedOrUpdated,xh as executeAction,_h as feedbackCreatedOrUpdated,Oh as knowledgeBaseRefreshed,wh as postInstall,Rh as preInstall};\n`;
|
package/index.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {execFileSync} from 'child_process'
|
|
3
|
-
import fs from 'fs'
|
|
4
|
-
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
import {compiledUserWorkerEntrypointScript} from './next.js'
|
|
7
|
-
|
|
8
|
-
const p = (f: string) => `${fs.existsSync('./src') ? 'src/' : ''}${f}`
|
|
9
|
-
|
|
10
|
-
fs.rmSync(p('app/mavenagi-cgi'), {recursive: true, force: true})
|
|
11
|
-
fs.mkdirSync(p('app/mavenagi-cgi'), {recursive: true})
|
|
12
|
-
fs.writeFileSync(p('app/mavenagi-cgi/next.ts'), `// @ts-nocheck\n${compiledUserWorkerEntrypointScript}`)
|
|
13
|
-
Object.entries({
|
|
14
|
-
'pre-install': 'preInstall',
|
|
15
|
-
'post-install': 'postInstall',
|
|
16
|
-
feedbacks: 'feedbackCreatedOrUpdated',
|
|
17
|
-
conversations: 'conversationCreatedOrUpdated',
|
|
18
|
-
'execute-action': 'executeAction',
|
|
19
|
-
'knowledge-base-refreshed': 'knowledgeBaseRefreshed',
|
|
20
|
-
}).forEach(([f, name]) => {
|
|
21
|
-
fs.mkdirSync(p(`app/mavenagi-cgi/v1/${f}`), {recursive: true})
|
|
22
|
-
const indexFileContents = fs.readFileSync(p(`index.ts`), 'utf8')
|
|
23
|
-
const isEdge =
|
|
24
|
-
indexFileContents.includes("export const runtime = 'edge'") ||
|
|
25
|
-
indexFileContents.includes('export const runtime = "edge"')
|
|
26
|
-
fs.writeFileSync(
|
|
27
|
-
p(`app/mavenagi-cgi/v1/${f}/route.ts`),
|
|
28
|
-
`// @ts-nocheck\nimport {${name}} from '../../next'
|
|
29
|
-
import userWorker from '../../../..'
|
|
30
|
-
|
|
31
|
-
export const POST = ${name}
|
|
32
|
-
export const runtime = ${isEdge ? "'edge'" : "'nodejs'"}
|
|
33
|
-
export const maxDuration = 900
|
|
34
|
-
`
|
|
35
|
-
)
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
let packageManager = 'npm'
|
|
39
|
-
if (fs.existsSync('yarn.lock')) {
|
|
40
|
-
packageManager = 'yarn'
|
|
41
|
-
} else if (fs.existsSync('pnpm-lock.yaml')) {
|
|
42
|
-
packageManager = 'pnpm'
|
|
43
|
-
} else if (fs.existsSync('bun.lockb')) {
|
|
44
|
-
packageManager = 'bun'
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
execFileSync(packageManager, ['run', ...process.argv.slice(2)], {stdio: 'inherit'})
|
|
49
|
-
process.exit(0)
|
|
50
|
-
} catch (err: any) {
|
|
51
|
-
process.exit(err.status || 1)
|
|
52
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
-
|
|
5
|
-
/* Projects */
|
|
6
|
-
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
7
|
-
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
-
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
9
|
-
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
10
|
-
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
-
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
-
|
|
13
|
-
/* Language and Environment */
|
|
14
|
-
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
15
|
-
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
-
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
|
-
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
18
|
-
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
|
-
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
20
|
-
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
21
|
-
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
22
|
-
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
23
|
-
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
|
-
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
|
-
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
26
|
-
|
|
27
|
-
/* Modules */
|
|
28
|
-
"module": "ES2022" /* Specify what module code is generated. */,
|
|
29
|
-
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
30
|
-
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
31
|
-
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
32
|
-
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
33
|
-
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
34
|
-
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
35
|
-
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
36
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
37
|
-
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
38
|
-
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
|
39
|
-
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
40
|
-
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
41
|
-
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
42
|
-
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
43
|
-
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
44
|
-
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
45
|
-
|
|
46
|
-
/* JavaScript Support */
|
|
47
|
-
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
48
|
-
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
49
|
-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
50
|
-
|
|
51
|
-
/* Emit */
|
|
52
|
-
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
53
|
-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
54
|
-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
55
|
-
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
56
|
-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
57
|
-
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
58
|
-
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
|
|
59
|
-
// "removeComments": true, /* Disable emitting comments. */
|
|
60
|
-
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
61
|
-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
62
|
-
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
63
|
-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
64
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
65
|
-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
66
|
-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
67
|
-
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
68
|
-
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
69
|
-
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
70
|
-
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
71
|
-
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
72
|
-
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
73
|
-
|
|
74
|
-
/* Interop Constraints */
|
|
75
|
-
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
76
|
-
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
|
77
|
-
// "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
|
|
78
|
-
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
79
|
-
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
|
80
|
-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
81
|
-
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
82
|
-
|
|
83
|
-
/* Type Checking */
|
|
84
|
-
"strict": true /* Enable all strict type-checking options. */,
|
|
85
|
-
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
86
|
-
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
87
|
-
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
88
|
-
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
89
|
-
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
90
|
-
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
91
|
-
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
92
|
-
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
93
|
-
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
94
|
-
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
95
|
-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
96
|
-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
97
|
-
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
98
|
-
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
99
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
100
|
-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
101
|
-
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
102
|
-
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
103
|
-
|
|
104
|
-
/* Completeness */
|
|
105
|
-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
106
|
-
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
107
|
-
}
|
|
108
|
-
}
|